Copy link to clipboard
Copied
Hi
I need help in this matter
The error which i get is this
Element A is undefined in FORM.
cfusion/wwwroot/ADD_DENEME.cfm: line 42
<form name="add_deneme" method="post" >
<table border="3">
<tr>
<td><strong>Musteri ID: </strong></td>
<td><input type="text" name="a" id="a" required="yes" >
</td></tr><br>
<tr>
<td><strong>Musteri Hareket Aciklama: </strong></td>
<td><input type="text" name="b" id="b" required="yes"> </td></tr>
<br>
<tr>
<td><strong>Musteri Tipi: </strong></td>
<td><input type= "text" name="c" id="c" required="yes"></td>
</tr>
</table>
<br><input type="submit" name="Kaydet" value="KAYDET">
</form>
<cfif IsDefined("form.a")>
<cfquery datasource= "DENEME" >
INSERT INTO MusteriHareketleri (MusteriId,Aciklama,musteriTipi)
values (
<cfqueryparam cfsqltype="cf_sql_integer" value="#form.a#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.b#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.c#">
)
</cfquery>
<cflocation url="http://127.0.0.1:8500/ADD_DENEME.cfm" addtoken="false">
</cfif>
<cfquery name="ADD" datasource="DENEME">
select * from MusteriHareketleri ;
</cfquery>
<cfquery name="update" datasource="DENEME">
UPDATE MusteriHareketleri
SET
MusteriId,
Aciklama="#form.b#",
musteriTipi="#form.c#"
WHERE
MusteriId="#form.a#"
</cfquery>
<cfdump var="#add#">
1 Correct answer
Your update statement at the bottom references form.a when it doesnt exists (before the page is posted). You need to move this up inide the CFIF where you check if form.a is defined.
Copy link to clipboard
Copied
Your update statement at the bottom references form.a when it doesnt exists (before the page is posted). You need to move this up inide the CFIF where you check if form.a is defined.

