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

Form submission

Status
Not open for further replies.

yimitz

Programmer
Apr 5, 2002
54
US
I have a form I'm trouble shooting, (it's lenghty), After a user selects a check box they are prompted to enter a date in a text field. I check the value of the text field with an onBlur event to make sure it's a date but if the user hits the return button the form posts. I have removed instances of method and action from <form name=&quot;myname&quot; method=&quot;post&quot; action=&quot;myaction.asp&quot;> and I've removed all submit buttons trying to figure out why the form still posts.

When I remove the method=&quot;post&quot; action=&quot;myaction.asp&quot; the page posts to itself. If I leave them in, the form posts to myaction.asp.

How is it posting without a submit routine or button of type submit?
 
if you use your validation in the form tag as onSubmit=&quot;&quot; then no matter what method the user submits (enter or click) the form will be validation script runs and returns errors as needed.
I assume the date is the last text field and that is why the enter key is sometimes being pressed. [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
That works!, it's actually not the last input field but I can live with the extra notifications when it runs through the validation routine if the user skips a field and goes to this field first (why they would I don't know but I have to figure somebody will eventually)

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top