ColdFusion Programming/Help with a Form
Expert: Donald Hammond - 1/24/2009
Question"This is my coding:
<cfquery name="Add" datasource="library"> INSERT INTO Authors (AuthLast, AuthFirst, PublishedWorks, Publisher, PubDate, Price, ISBN) VALUES ('#Form.AuthLast#',
'#Form.AuthFirst#',
'#Form.PublishedWorks#',
'#Form.Publisher#',
#Form.PubDate#,
#Form.Price#,
#Form.ISBN#)
</cfquery>
The problem that I'm having is that I get the following error:
Element PUBLISHER is undefined in FORM."
Can you help?
AnswerAloha,
You didn't show the form so that is what I recommend. Check the form to make sure Publisher is a field in the form and is spelled the same way.
Also you need to verify that all fields have an entry before attempting to put them in the database. So doing a <cfparam name="form.publisher" default=""> will at least give a blank entry.
If all else fails, put this before the query to see what the form is sending over.
<cfoutput><cfdump var="#form#"></cfoutput>
That will show you everything that is being sent by the form