Disable a submit button with onclick?

liunx

Guest
I have a file upload form that will alow a user to browse for a file & then ul the file to me.<br />
<br />
<br />
A user can still click the browse button & the submit button while the rest of my asp script is being processed.<br />
<br />
What I need to know is there a way to disable a form's submit button with an onclick action & whatmore can it disable another button (the file browse) at the same time?<!--content-->I am trying this but my form post action is to an asp file that handles the ul.<br />
<br />
when I disable the form onsubmit the post fails.<!--content--><input type="button" value="Submit" onclick="this.disabled=1; this.form.submit();"><br />
<br />
Not tested, may need DOM tweaking.<!--content-->Got a work around with a lil bit of javascript.<br />
<br />
I set a variable for each button on my form & increment them whne clicked. then if they go over my set value I pop an alert instead of processing the form. <br />
<br />
Thanks for responding it kinda pointed me in the direction I took.<!--content-->Originally posted by Sceiron <br />
<input type="button" value="Submit" onclick="this.disabled=1; this.form.submit();"><br />
<br />
Not tested, may need DOM tweaking. <br />
<br />
I tried something like this but the post still wouldn't process. <br />
<br />
all is good now though I got the other work around going & am satisfied with it.<!--content-->try this<br />
<br />
<input name="myBtn" type="button" value="disabler" onClick="mySubmit.disabled=true;myFile.disabled=true"><br />
<input name="mySubmit" type="submit"><br />
<input name="myFile" type="file"><!--content-->
 
Back
Top