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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using CFFORM 2

Status
Not open for further replies.

ecojohnson

Programmer
Jul 2, 2001
54
US
I've got a weird problem that if anyone has an idea on how to resolve it, I would love to hear it.

I have a form that has a list of text boxes. There is one value for the text boxes that is a default value and therefore, it is not a valid entry (the user must change the default value to something else). Originally, before I used CFFORM, I used the standard FORM tag and used a Javascript "ONSUBMIT" function that went something (but not exactly) like:

<script = Javascript>
function checkvalue() {
if forms.formname.selectname.value == &quot;DefaultValue&quot; {
alert (&quot;This is not a valid value. Please try again&quot;)
return false
)
)
</script>

<FORM Action=&quot;Form2&quot; Method=&quot;Post&quot; Name=&quot;Formname&quot; OnSubmit=&quot;checkvalue()&quot;>
<Input Type=&quot;text&quot; Value=&quot;DefaultValue&quot; Name=&quot;Text1&quot;>
.....
</FORM>

Using this code, everything went fine. However, I recently decided to go with the CFFORM instead of the FORM tag (to use the validation attributes for the CFINPUT tags). But, when I change the FORM tag to CFFORM, I noticed that my &quot;ONSUBMIT&quot; Javascript function no longer works. I get an error everytime. As soon as I take the CFFORM off and revert back to the regular FORM tag, it works just fine.

Any ideas why?
 
If you are comfortable with writing/maintaining your own JavaScripts you may want to skip the CFFORM alltogether :)

Just try to place several form elements with the same name (like a &quot;list&quot; of textboxes or checkboxes)into a single form and you will find that CFFORM will just choke.

On the other hand, for very simple forms, CFFORM speeds up the development proccess considerably :)
 
Hmmm. That's interesting. I didn't really know that. Thanks for the tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top