Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic form - client side validation

Status
Not open for further replies.

saurabh

Programmer
Jul 10, 2000
27
0
0
IN
i have generated a dynamic form from the SQL database....meaning that radio buttons/checkboxes/textarea/text are all being generated based on certain conditions. This code caters to 6-7 different forms.<br><br>now i want to do client side validation or server side for some fields so that they don't remain empty..these fields may differ from FORM to FORM. Also the name of radio/checkboxes tag's in HTML are being generated dynamically...as form is dependent on entries in DB.<br><br>how do i do it...any suggestions?
 
The easiest way would be to use the CFFORM tag instead of the FORM tag, then use CFINPUT tags with the REQUIRED=&quot;YES&quot; and MESSAGE=&quot;You must input your name&quot; options....<br><br>Example:<FONT FACE=monospace><b><br>&lt;CFFORM ACTION=&quot;NextPage.cfm&quot; METHOD=&quot;POST&quot;&gt;<br>&lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;FirstName&quot; REQUIRED=&quot;Yes&quot; MESSAGE=&quot;Please enter your first name.&quot;&gt;<br>&lt;/CFFORM&gt;<br></b></font>
 
An extraneous end tag &lt;/CFFORM&gt; has been encountered at document position (84:1) to (84:9). End tags cannot be present in CFML templates without a matching start tag.<br><br>This is the error i get when i use the CFFORM tag...i have checked the code both the start and the end tags are present. <br><br>Within the start and the end tag there is switch expression for evaluation of condition based on which forms are getting generated.<br><br><br>suggest something............
 
check if u put ur &lt;/cfform&gt; tag immediately after the &lt;cfform&gt; tag on the same line. U should put it on the last line of ur code after your form code.&nbsp;&nbsp;<br>That's all i can think of.<br>Praveen
 
&quot;Within the start and the end tag there is switch expression for evaluation of condition based on which forms are getting generated.&quot;<br><br>Thats what i have written in the problem ...between start and end tags there is lot of code.........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top