Skip to main content
Participant
October 31, 2011
Answered

Element submit is undefined in the form

  • October 31, 2011
  • 1 reply
  • 708 views

Hello,this is Mr -Bat n  i am getting this error when i display forms every operations work n the error disappears after subit button is pressed then it goes  why it happens.ca anyone help me please. inthe code i have written this:

<cfif IsDefined(form.submit)>

<cfquery name="New" datasource="CFM">

Insert into dbo.City_Master(City_Id,City_Description,State_description)

Values(#CityCode#,'#Cityname#','#State#')

</cfquery>

<cfquery name="Update" datasource="CFM">

Update dbo.City_Master set City_Description='#Cityname#' where State_description='#State#'

</cfquery>

<cfquery name="Search" datasource="CFM">

Select * from dbo.City_Master

</cfquery>

</cfif>

This topic has been closed for replies.
Correct answer Owainnorth

Hello Mr Bat.

It's because you've used isDefined improperly. It takes a string as an argument, you're trying to pass it the *value* of form.submit, which does not exist.

1 reply

Owainnorth
OwainnorthCorrect answer
Inspiring
October 31, 2011

Hello Mr Bat.

It's because you've used isDefined improperly. It takes a string as an argument, you're trying to pass it the *value* of form.submit, which does not exist.