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

re form validation with onSubmit

Status
Not open for further replies.

thibault

Programmer
Sep 8, 1999
44
US
i tried using &quot;return false;&quot;.&nbsp;&nbsp;you're right that it doesn't submit the form when i use &quot;return false;&quot;, but it tells the users that it is submitting the form.&nbsp;&nbsp;i don't want it to do that. <p>bobbie<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>
 
Dear bobbie,<br><br>&gt; it tells the users that it is submitting the form<br><br>What is 'it'?<br><br>-pete
 
I'm assuming he meant the status line, or the page in general or something... my question is, the subject line contains &quot;re&quot; and the subject of a previous thread.. why the new thread? <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
this is &quot;it&quot;...the function that is called &quot;onSubmit&quot;.&nbsp;&nbsp;as i said, if the length criteria are met it does not set the focus back to the indicated field.&nbsp;&nbsp;it displays an alert box which states that it is submitting the form via e-mail.&nbsp;&nbsp;then it does nothing.<br>ps: i'm not a 'he'.&nbsp;&nbsp;i'm a 'she'.:)<br><br>&nbsp;&nbsp;&nbsp;function checkValue() { // check for null field value<br> if (document.frmOrder.Assoc.value.length &lt; 1) {<br> val = window.eval(&quot;document.frmOrder.Assoc.focus()&quot;);<br> alert(&quot;A value must be entered in the Associate Name field.&quot;);<br> return false;<br> }<br> if (document.frmOrder.Assoc.value.length &lt; 1) {<br> val = window.eval(&quot;document.frmOrder.Guest.focus()&quot;);<br> alert(&quot;A value must be entered in the Customer Name field.&quot;);<br> return false;<br> }<br> else {<br> submitIt();<br> }<br>} <p>bobbie<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>
 
Dear bobbie,<br><br>Is this a form where the 'action' attribute is set to a 'mailto' protocol? If so try doing this to stop the dialog from appearing.<br><br>Set the action attribute to point to a web page rather than putting the 'mailto:... ' in it. Then in your 'submitIt()' function set the action attribute to the 'mailto:... ' value, i.e.:<br><br>function submitIt(){<br>&nbsp;&nbsp;document.myform.action = 'mailto:<A HREF="mailto:thibault@hotbot.com">thibault@hotbot.com</A>';<br>&nbsp;&nbsp;... rest of stuff<br>}<br><br>Hope this helps<br>-pete
 
my apologies, Bobbie, your name threw me for a loop :eek:) <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top