|
-
Feb 2nd, 2005, 11:26 AM
#1
Thread Starter
Addicted Member
Reset webform without using HTML reset button???
On my webform I am currently using the HTML Reset button to reset the form. The problem is that when the form is viewed by someone to approve I would like to hide the button along with some other options to be available only on data entry.
Is there another way i can reset the form, possibly in vbscript.
I tried doing it in javascript but the validateRequiredFields that I have on the form fires stopping the reset.
Anyone have any ideas?
Thanks.
-
Feb 2nd, 2005, 11:32 AM
#2
Frenzied Member
Re: Reset webform without using HTML reset button???
Where are you firing the JavaScript from? Can you turn of the CauseValidation for that Control?
Magiaus
If I helped give me some points.
-
Feb 2nd, 2005, 01:00 PM
#3
Re: Reset webform without using HTML reset button???
Use an asp:button whose causesvalidation property is false. In its codebehind, run through the control, setting textboxes to blank, comboboxes to first element, and so on.
-
Feb 2nd, 2005, 02:19 PM
#4
Thread Starter
Addicted Member
Re: Reset webform without using HTML reset button???
The javascript was in the onclick event for the asp button.
I didn't even notice the CauseValidation property for the button, I will try it now with that set to false and I am sure it should work now.
Thanks again guys.
Magiaus, you always get my posts, thanks again. You should have my job.
-
Feb 2nd, 2005, 08:36 PM
#5
I wonder how many charact
Re: Reset webform without using HTML reset button???
To me reseting the form means making it contain the initial values it had when it was served to the client. Therefore - simply blanking out text boxes and selecting the first index of a combobox is not a reset - its a clear.
Now, I don't know what your true intention was (reset or clear), but if it was the former then all you really need to suceed at it is:
document.forms[0].reset();
which resets all form values to their initial values as they were when the form was delivered to the client.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|