You're using cfform, right?  Form.submit() does not drive the form
submission event.  What you can do is look at your form page's html
source and find the javascript in the <form> tag that is called when the
form is submitted.  Call the same functions in your button tag and it
should work.


- Matt Small


-----Original Message-----
From: Tim [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 27, 2002 2:01 PM
To: CF-Talk
Subject: Forms: submit via button and required fields not working

I have a form that I wanted to restrict so that the user has to hit the
Submit button to enter the form, and not the Enter key.  I included the
following:

<input type="button" name="Submit" Value="Submit Request"
onClick="form.submit()">

This does work as far as resticting the Enter Key, but the Required
attribute does not work now.  The user does not get a message if a
required field is left blank, and the form is acted upon, producing
errors.  If I take the above code out and insert a plain submit button,
the Required attribute works, but not restricting the Enter key.

Anyone have an idea on how to do both, restrict form submission only
when the button is selected and checking for required fields?

Tim



---------------------------------
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy AwardsR

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to