How To Automatically Re-Set Form?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
jbh
Forum Commoner
Posts: 89
Joined: Tue Dec 05, 2006 7:01 pm

How To Automatically Re-Set Form?

Post by jbh »

Hey,

I have a form with 10 surveys. Each survey has a submit button.
One problem with this is that if one submits a survey and then tries another one,
the values of both surveys are passed.

This can be solved if I can automatically, after my "post submission" functions conclude
it can re-set it in the background. One issue is that I have a css overlay and if I redirect
the overlay disappears. It's critical that the overlay is kept.

So, is it recommended to create a reset function immediately upon submission of the survey?
What is the best idea here?

Thanks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How To Automatically Re-Set Form?

Post by pickle »

You can't really reset the form before it's submitted - you'll lose all the data. After the submission is another page load.

I'm pretty sure forms have a reset() function you can call.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
carolin
Forum Newbie
Posts: 7
Joined: Thu Jan 21, 2010 3:32 am

Re: How To Automatically Re-Set Form?

Post by carolin »

you can use reset() function call..
Post Reply