Skip to main content
Participating Frequently
September 18, 2019
Answered

HELP

  • September 18, 2019
  • 1 reply
  • 1131 views

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#">

    This topic has been closed for replies.
    Correct answer haxtbh

    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.

    1 reply

    haxtbhCorrect answer
    Inspiring
    September 18, 2019

    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.