8 13575
The reason why Name is undefined in Form is that you have defined the input element as "Name_Required" and not "Name".
my code is: polladd.cfm: - <cfinclude template="head.cfm">
-
<p>
-
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
-
<tr>
-
<td>
-
<div align="center">
-
<P align="left"><strong><font size="+1">Add a New Record </font></strong></P>
-
<p align="left">Add your record: </p>
-
<form method="post" action="polladdaction.cfm">
-
<input type="Hidden" name="Name" Value="You must have a Name!">
-
<input type="Hidden" name="Address" Value="You must have an Address!">
-
-
<table width="100%" border="0" cellspacing="0" cellpadding="2">
-
<tr>
-
<td width="25%"><p><strong>Name:</strong></p></td>
-
<td width="75%"><p>
-
<input type="text" name="Name" size="40" maxlength="50">
-
</p></td>
-
</tr>
-
<tr>
-
<td> </td>
-
<td> </td>
-
</tr>
-
<tr>
-
<td width="25%"><p><strong>Address:</strong></p></td>
-
<td width="75%"><p>
-
<input type="text" name="Address" size="40" maxlength="50">
-
</p></td>
-
</tr>
-
</table>
-
<BR>
-
<div align="left">
-
<input type="submit" name="SubmitButton" value="Add the Record">
-
<input type="reset" name="ResetButton" value="Reset">
-
</div>
-
</form>
-
</div>
-
</td>
-
</tr>
-
</table>
-
-
<cfinclude template="foot.cfm">
-
-
-
and another form is: polladdaction.cfm - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
<html>
-
<head>
-
<title>Add a Poll Action Page</title>
-
</head>
-
<body>
-
-
<!--- Set the data that is to be updated and the tables they apply to --->
-
-
<cfquery name="InsertName" datasource="test">
-
INSERT
-
INTO Names
-
(Name)
-
VALUES
-
('#Form.Name#')
-
</cfquery>
-
-
<cfquery name="getLastID" datasource="test">
-
SELECT MAX(NameID) as LastID
-
FROM Names
-
</cfquery>
-
-
<cfloop list="#form.Address#" index="FormAddress" delimiters=":">
-
<cfquery name="InsertAddresses" datasource="test">
-
INSERT INTO Addresses(NameID,Address)
-
VALUES('#getLastID.LastID#','#FormAddress#')
-
</cfquery>
-
</cfloop>
-
-
-
<cflocation url="polls.cfm">
-
</body>
-
</html>
-
but i got error messages as follows:
Error Occurred While Processing Request
Element NAME is undefined in FORM.
The error occurred in C:\CFusionMX\wwwroot\FusionPoll\Admin\polladdactio n.cfm: line 15
13 : (Name)
14 : VALUES
15 : ('#Form.Name#')
16 : </cfquery>
17 :
--------------------------------------------------------------------------------
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Remote Address 127.0.0.1
Referrer
Date/Time 29-Apr-07 11:25 PM - Stack Trace (click to expand)
-
at cfpolladdaction2ecfm316826830.runPage(C:\CFusionMX\wwwroot\FusionPoll\Admin\polladdaction.cfm:15)
-
-
-
coldfusion.runtime.UndefinedElementException: Element NAME is undefined in FORM.
-
at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1049)
-
at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1026)
-
at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1125)
-
at cfpolladdaction2ecfm316826830.runPage(C:\CFusionMX\wwwroot\FusionPoll\Admin\polladdaction.cfm:15)
-
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)
-
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:357)
-
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:62)
-
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:107)
-
at coldfusion.filter.PathFilter.invoke(PathFilter.java:80)
-
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:47)
-
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
-
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:35)
-
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)
-
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
-
at coldfusion.CfmServlet.service(CfmServlet.java:105)
-
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
-
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
-
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
-
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
-
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
-
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
-
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
-
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
-
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
-
what may be the problem please help me!!!
You've defined Name and Address twice - once as a hidden field and once as a normal text input field.
You've defined Name and Address twice - once as a hidden field and once as a normal text input field.
I get the exact same problem and my code looks like this:
(note: I practically copied the code directly out on an O'reilly book for this) - <form name="form1" id="form1" method="post" action="course_confirm.cfm">
-
<table width="80%" border="0" align="center" cellpadding="4" cellspacing="2">
-
<tr>
-
<td colspan="4" align="right"> </td>
-
</tr>
-
<tr>
-
<td width="19%" align="right" valign="top"><strong>Course Name: </strong></td>
-
<td colspan="3"><input name="name" type="text" class="formtext" id="name" size="50" /></td>
-
</tr>
-
<tr>
-
<td align="right" valign="top"><strong>Course Category: </strong></td>
-
<td colspan="3"><select name="category" class="formtext" id="category">
-
<option value="No Category Selected" selected="selected">Select a Category</option>
-
<option value="Computing and Information Technology">Computing and Information Technology</option>
-
<option value="Communication Skills">Communication Skills</option>
-
<option value="Project Planning and Research Methodology">Project Planning and Research Methodology</option>
-
<option value="Management Skills">Management Skills</option>
-
<option value="Science Communication">Science Communication</option>
-
</select></td>
-
</tr>
-
<tr>
-
<td align="right" valign="top"><strong>Course Description </strong></td>
-
<td colspan="3"><textarea name="description" cols="75" rows="6" wrap="VIRTUAL" class="formtext" id="description"></textarea></td>
-
</tr>
-
<tr>
-
<td align="right" valign="top"><strong>Prerequisites:</strong></td>
-
<td colspan="3"><textarea name="prerequisites" cols="75" rows="3" wrap="VIRTUAL" class="formtext" id="prerequisites"></textarea></td>
-
</tr>
-
<tr>
-
<td align="right" valign="top"><strong>Who Should Attend: </strong></td>
-
<td colspan="3"><textarea name="attend" cols="75" rows="3" wrap="VIRTUAL" class="formtext" id="attend"></textarea></td>
-
</tr>
-
<tr>
-
<td align="right" valign="top"><strong>Precourse:</strong></td>
-
<td colspan="3"><textarea name="precourse" cols="75" wrap="VIRTUAL" class="formtext" id="precourse"></textarea></td>
-
</tr>
-
<tr>
-
<td align="right"><strong>Tutor 1: </strong></td>
-
<td width="24%"><select name="tutor1" class="formtext" id="tutor1">
-
<option value="No Category Selected" selected="selected">Select a Tutor</option>
-
<cfoutput query="tutors">
-
<option value="#tutors.Tutor_ID#">#tutors.Tutor_Name#</option>
-
</cfoutput>
-
</select></td>
-
<td width="11%" align="right"><strong>Tutor 2: </strong></td>
-
<td width="46%"><select name="tutor2" class="formtext" id="tutor2">
-
<option value="No Category Selected" selected="selected">Select a Tutor</option>
-
<cfoutput query="tutors">
-
<option value="#tutors.Tutor_ID#">#tutors.Tutor_Name#</option>
-
</cfoutput>
-
</select></td>
-
</tr>
-
<tr>
-
<td align="right"><strong>Tutor 3:</strong></td>
-
<td><select name="tutor3" class="formtext" id="tutor3">
-
<option value="No Category Selected" selected="selected">Select a Tutor</option>
-
<cfoutput query="tutors">
-
<option value="#tutors.Tutor_ID#">#tutors.Tutor_Name#</option>
-
</cfoutput>
-
</select></td>
-
<td align="right"><strong>Tutor 4: </strong></td>
-
<td><select name="tutor4" class="formtext" id="tutor4">
-
<option value="No Category Selected" selected="selected">Select a Tutor</option>
-
<cfoutput query="tutors">
-
<option value="#tutors.Tutor_ID#">#tutors.Tutor_Name#</option>
-
</cfoutput>
-
</select></td>
-
</tr>
-
<tr>
-
<td align="right"><br /></td>
-
<td colspan="3"><br />
-
<input name="Submit" type="submit" class="formtext" value="Submit" />
-
<input name="Reset" type="reset" class="formtext" value="Reset" /></td>
-
</tr>
-
</table>
-
</form>
-
and - <cflock name="insertCourse" type="exclusive" timeout="20">
-
<cftransaction>
-
<cfquery name="insertNewCourse" datasource="#request.dsn#">
-
INSERT INTO Courses (Course_Name, course_category, course_description, prerequisites,
-
who_attend, Precourse)
-
VALUES ('#form1.name#', '#form1.category#', '#form1.description#', '#form1.prerequisites#',
-
'#form1.attend#', '#form1.precourse#')
-
</cfquery>
-
<cfquery name="getKey" datasource="#request.dsn#">
-
SELECT Max(Course_ID) AS MaxID
-
FROM Courses
-
</cfquery>
-
</cftransaction>
-
</cflock>
-
-
<cflock name="inserttutorassoc" type="exclusive" timeout="20">
-
<cftransaction>
-
<cfif #from1.tutor1# is not "No Category Selected">
-
<cfquery name="tutor1" datasource="#request.dsn#">
-
INSERT INTO Tutorlist(fk_course_id, fk_tutor_id)
-
VALUES(#getKey.MaxID#,#form1.tutor1#)
-
</cfquery>
-
</cfif>
-
<cfif #from1.tutor2# is not "No Category Selected">
-
<cfquery name="tutor2" datasource="#request.dsn#">
-
INSERT INTO Tutorlist(fk_course_id, fk_tutor_id)
-
VALUES(#getKey.MaxID#,#form1.tutor2#)
-
</cfquery>
-
</cfif>
-
<cfif #from1.tutor3# is not "No Category Selected">
-
<cfquery name="tutor3" datasource="#request.dsn#">
-
INSERT INTO Tutorlist(fk_course_id, fk_tutor_id)
-
VALUES(#getKey.MaxID#, #form1.tutor3#)
-
</cfquery>
-
</cfif>
-
<cfif #from1.tutor4# is not "No Category Selected">
-
<cfquery name="tutor4" datasource="#request.dsn#">
-
INSERT INTO Tutorlist(fk_course_id, fk_tutor_id)
-
VALUES(#getKey.MaxID#, #form1.tutor4#)
-
</cfquery>
-
</cfif>
-
</cftransaction>
-
</cflock>
I'd also be very curious to fond out what could possibly be wrong here ...
Thanks in advance
Use #form...# instead of #form1...#
Use #form...# instead of #form1...#
thanks, I will give that a shot
Use #form...# instead of #form1...#
that worked a treat! Thanks :)
that worked a treat! Thanks :)
No problem, you're welcome. Post again if you have any more questions.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Wm |
last post by:
I'm having a very hard time trying to add an edited listing to mySQL. I'm
breaking this in to two halves, so that each error/problem can
be pinpointed.
The edit form queries mySQL and fills in...
|
by: Dan Roberts |
last post by:
I am running some off-the-shelf software that is written in ASP, which uses
JScript to generate dynamic content within HTML forms. There are several ASP
pages which are partially rendering to IE,...
|
by: Phil Campaigne |
last post by:
Hi All,
I just installed postgresql 7.3.4 as an upgrade to 7.3.2 and all went
well untill I tried to log into a database that I successfully created.
Here are the steps in question:
bash-2.05b$...
|
by: NTPT |
last post by:
Regardi
I recently compile Postgresql 7.4.3 with gcc 3.4.0 on RH 7.3 . Regression tests work well All passed, but
Some binaries report a relocation error: :pg_dumpall undefined symbol...
|
by: Alan Silver |
last post by:
Hello,
I'm getting an odd validation error from VWD. As I understand it, an
opening ASP.NET for tag is supposed to look like...
<form runat="server">
with an optional ID attribute. VWD...
|
by: patjones |
last post by:
Good morning all:
In what seems like an ongoing saga to make the DSum function do what I need it to, I am now having trouble with a user-defined function in my VBA module. Here's the offending...
|
by: CCHDGeek |
last post by:
I created a database with a separate front-end that is installed on each computer and linked to a back-end server. After installing the file on several computers, I realized I was getting this...
|
by: William Hamilton |
last post by:
Hi all,
Hoping someone might be able to point me in the right direction with getting the code below to work properly.
Effectively, the code:
Requerys the listbox in lstPrintCheckedStaff...
|
by: Mary meer |
last post by:
i am trying to switch array value but i get this error message: Undefined offset 2
$at=array(
array('Title:','title',2,10),
array('First Name:','fname',2,10 ),
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |