ecojohnson
Programmer
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 == "DefaultValue" {
alert ("This is not a valid value. Please try again"
return false
)
)
</script>
<FORM Action="Form2" Method="Post" Name="Formname" OnSubmit="checkvalue()">
<Input Type="text" Value="DefaultValue" Name="Text1">
.....
</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 "ONSUBMIT" 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?
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 == "DefaultValue" {
alert ("This is not a valid value. Please try again"
return false
)
)
</script>
<FORM Action="Form2" Method="Post" Name="Formname" OnSubmit="checkvalue()">
<Input Type="text" Value="DefaultValue" Name="Text1">
.....
</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 "ONSUBMIT" 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?