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!

disregard the last newby quest: now my "onSubmit" won't work.

Status
Not open for further replies.

thibault

Programmer
Sep 8, 1999
44
US
onSubmit...i did it just the way the book did it, but when i submit i get no alert.<br>hmmmmmmm:¦<br><br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;TITLE&gt;Special Order Form&lt;/TITLE&gt;<br><br>&lt;SCRIPT LANGUAGE=&quot;Javascript&quot;&gt;<br><br>var vHolder = 0;<br><br>&nbsp;&nbsp;&nbsp;function setFocus() {<br> document.frmOrder.Store.focus(); // set initial focus<br>}<br><br><br>&nbsp;&nbsp;&nbsp;function checkLoc_cd(vLoc_cd) { // set vLoc_cd to the proper length<br> if (vLoc_cd.length==0) { // check for null field value<br> &nbsp;&nbsp;&nbsp;&nbsp;if (vHolder==0) {<br> vHolder = 1;<br> document.frmOrder.Store.focus();<br> alert(&quot;A value must be entered in this field.&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;}<br> }<br>&nbsp;&nbsp;&nbsp;if (vLoc_cd.length==2){ // loc-cd must be 3 characters long<br> vLoc_cd = &quot;0&quot; + vLoc_cd;<br> }<br>&nbsp;&nbsp;&nbsp;else if (vLoc_cd.length==1){<br> vLoc_cd = &quot;00&quot; + vLoc_cd;<br> }<br>&nbsp;&nbsp;&nbsp;document.frmOrder.Store.value = vLoc_cd;<br>&nbsp;&nbsp;&nbsp;vHolder = 0;<br>}<br><br>&nbsp;&nbsp;&nbsp;function checkValue(vValue,vName) { // check for null field value<br> if (vValue.length==0) {<br> &nbsp;&nbsp;&nbsp;&nbsp;if (vHolder==0) {<br> vHolder = 1;<br> alert(vName);<br> val = window.eval(&quot;document.frmOrder.&quot;+vName+&quot;.focus()&quot;);<br>/*<br> document.frmOrder.Assoc.focus();<br>*/<br> alert(&quot;A value must be entered in this field.&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;}<br> }<br>}<br><br><br>&lt;/SCRIPT&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY onLoad=&quot;setFocus();&quot;&gt;<br>&lt;IMG SRC=&quot;ultstore.jpg&quot; align=center HEIGHT=28 WIDTH=180&gt;<br>&lt;CENTER&gt;&lt;H3&gt;SPO Department Inquiry & Order Form&lt;/H3&gt;&lt;/CENTER&gt;<br><br>&lt;FORM NAME=&quot;frmOrder&quot; ACTION=&quot;mailto:<A HREF="mailto:rthibaul@ultrastores.com">rthibaul@ultrastores.com</A>&quot; METHOD=&quot;POST&quot; ENCTYPE=&quot;text/plain&quot;<br> onSubmit=&quot;alert(&quot;Hi&quot;);&quot;&gt;<br>&nbsp;&nbsp;&lt;TABLE WIDTH=&quot;95%&quot; BORDER=1&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD&gt;Store&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=3 NAME=&quot;Store&quot; onBlur=&quot;checkLoc_cd(value);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Associate Name&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;Assoc&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Today's Date&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;Date&quot; VALUE=&quot;6/23/00&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD COLSPAN=2&gt;Date Order Needed In Store&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;Needed&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD COLSPAN=3&gt;Customer Name&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;30&quot; NAME=&quot;Guest&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD ROWSPAN=3 COLSPAN=2&gt;&lt;B&gt;One option must be selected&lt;B/&gt;&lt;BR&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=RADIO NAME=&quot;50%&quot; SELECTED&gt;50% DEPOSIT AMOUNT&lt;BR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=RADIO NAME=&quot;PAID&quot;&gt;PAID IN FULL AMOUNT&lt;BR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=RADIO NAME=&quot;TRANS&quot;&gt;TRANSFER/EXCHANGE&lt;BR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=RADIO NAME=&quot;INQUIRY&quot;&gt;INQUIRY ONLY&lt;BR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD COLSPAN=3&gt;Address&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;40&quot; NAME=&quot;Domicile&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD COLSPAN=2&gt;Home Phone&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;20&quot; NAME=&quot;Home&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Work Phone&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;20&quot; NAME=&quot;Work&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD&gt;SKU to reference&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;SKU&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Metal&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;metal&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Color&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;color&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Size/Length&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;size&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;Retail&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;15&quot; NAME=&quot;retail&quot; onBlur=&quot;checkValue(value,name);&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD COLSPAN=5&gt;Special Instructions&lt;BR&gt;&lt;INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;55&quot; NAME=&quot;instructions&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD COLSPAN=5&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=&quot;submit&quot; VALUE=&quot;Submit&quot; ACTION=SUBMIT&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=&quot;reset&quot; VALUE=&quot;Reset&quot; ACTION=RESET onClick=&quot;setFocus();&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&nbsp;&nbsp;&lt;/TABLE&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;FONT FACE=&quot;Arial&quot; SIZE=2&gt;Copyright Ultra Stores, Inc. 2000&lt;/FONT&gt;<br>&lt;/FORM&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt; <p>bobbie<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>
 
bobbie,<br><br>&gt; onSubmit=&quot;alert(&quot;Hi&quot;);&quot;&gt;<br><br>... is createing a parsing error, change it to this:<br><br>onSubmit=&quot;alert('Hi');&quot;&gt;<br>&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top