This should work to maintain type=submit:

<input type="submit" name="submitted" value="Generate Report"
onClick="if(this.value == 'Generate Report'){
this.value='Running Report...';return true;}else{return false};"
class="submit">

(remove line wraps in the onClick parameter)

Ron Hornbaker
Co-Founder, BookCrossing.com

BOOKS JUST WANNA BE FREE! http://BookCrossing.com



> -----Original Message-----
> From: Dave Carabetta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 17, 2002 10:37 AM
> To: CF-Talk
> Subject: RE: Submitting a form only once, iow, preventing impatient user
> d ouble clicks.
>
>
> >Use javascript to disable the submit button once it's been clicked.
> >
> >I tend to use an input type="button" so idtio users pressing
> return when
> >they shouldn't, don't actually submit the form early.
> >
> ><input type="Button" value="Submit"
> onclick="javascript:this.value='Please
> >Wait';this.disabled=1;document.forms[0].submit()">
> >
> >Should do the trick
> >
>
> OK, so I've been looking into this same problem myself and
> decided to create
> a test page with the examples posted. I'm having a strange
> problem and was
> hoping somebody could point out what I'm doing wrong.
>
> I almost always have my forms post to themselves, and then test for the
> existence of the submit button's name. If I use:
>
> <input type="button" name="submitted" value="Generate Report"
> onClick="if(this.value == 'Generate Report') this.form.submit();
> this.value='Running Report...';" class="submit">
>
> the page submits to itself, but the existence check fails:
>
> <cfif IsDefined("form.submitted")>
>    Run the processing code.
> </cfif>
>
> However, if I change the input type to "submit" the page
> submits just fine
> and runs the processing code. Why would the submit button's
> name not exist
> if the type="button", but it does exist if I change it to type="submit"?
>
> To further complicate the issue, if I have the input
> type="submit" and use
> the this.disabled = 1; feature, the processing does not occur either.
> Removing this.disabled processes the form perfectly.
>
> I'm testing in IE 6, if that makes a difference. I'm gonna go
> try Nutscrape
> now and see what happens.
>
> Any thoughts?
>
> Thanks,
> Dave.

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to