Have you tired changing this:

onsubmit="submitForm();"

to this:

onsubmit="return submitForm();"

You need to explicitly tell the browsers onSubmit event handler to return
true or false. If you don't, it will behave as you are describing.

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org 


 

>-----Original Message-----
>From: 
>[EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED]
o.uk] On Behalf Of Paul Swingewood
>Sent: Thursday, August 12, 2004 9:50 AM
>To: [EMAIL PROTECTED]
>Subject: RE: [ cf-dev ] js drives me mad
>
>Tried all that still posts the form instead of returning to 
>the submit page.
>
>I know have.
>
><script language="JavaScript">
><!--
>function submitForm()
>{
>if (document.addsubctgry.subcatpic.value == "")
>{
>alert("You must enter a picture for this subcategory.");
>return false;
>}
>}
>// -->
></script>
>.
>.
>.
>.
><form name="addsubctgry" action="adsbctac.cfm" 
>onsubmit="submitForm();" 
>enctype="multipart/form-data">
>       <TABLE BORDER="0" CELLPADDING="3">
>       <tr>
>               <td><b>ADD SUB-CATEGORY</b><p></p></td>
>       </tr>
>       <TR>
>               <td valign="top">Sub-Category Name :</td>
>               <td>
>                       <input type = "text"
>                               name = "SubctgryName">
>               </td>
>       </tr>
>       <tr>
>               <td valign="top">Please select a picture for 
>this Sub-Category</td>
>               <td valign="top">
>                       <input  type="file" size="35" name="subcatpic">
>               </td>
>       </tr>
>       <tr>
>               <td valign="top">
>                       <input type="submit" name="clickme" 
>value="Add Sub-Category">
>               </td>
>       </tr>
>       </table>
>       </form>
>
>Back to a standard form. Ive tried cfform & form but still it 
>always posts 
>the form.
>Am I missing some kind of 'setfocus' element or something?
>
>Regards - Paul
>
>
>
>-- 
>These lists are syncronised with the CFDeveloper forum at 
>http://forum.cfdeveloper.co.uk/
>Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
>CFDeveloper Sponsors and contributors:-
>*Hosting and support provided by CFMXhosting.co.uk* :: 
>*ActivePDF provided by activepdf.com*
>      *Forums provided by fusetalk.com* :: *ProWorkFlow 
>provided by proworkflow.com*
>           *Tutorials provided by helmguru.com* :: *Lists 
>hosted by gradwell.com*
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>


-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to