By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

problem with method reset()

P: n/a
if in a page I have a search form and I want use the method reset()
for reinsert the default values, I notice that after a research, for
the method reset(), the default values aren't more that first time loaded
in the form but that of the form set for the search (I think so);
see that the form is inner the same result's page, pheraphs
the reset() 'see' how default values only the last form and not those
that is loaded initially;

is there some tip?
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Apr 28, 12:48 am, artev <mailnotspa...@notspamm.nnwrote:
if in a page I have a search form and I want use the method reset()
for reinsert the default values, I notice that after a research, for
the method reset(), the default values aren't more that first time loaded
in the form but that of the form set for the search (I think so);

see that the form is inner the same result's page, pheraphs
the reset() 'see' how default values only the last form and not those
that is loaded initially;

is there some tip?
Method reset() will set all values back to what it was ON page LOAD,
so if you want it to behave the way you describe (if I understand it
correctly) you can:
1) provide your own reset() function
example code
<input type="..." defaultValue="..." value="..." />
....
<input type="reset" onclick="myReset()" ... />
in you function take values from defaultValue attribute and assign it
to value attribute...
2) if you DO NOT want to override the reset() function you can load
the page with default values and set current (search specific) values
in onLoad script, then std reset() will work the way you want...
Jun 27 '08 #2

P: n/a
VK
On Apr 28, 3:48 am, artev <mailnotspa...@notspamm.nnwrote:
if in a page I have a search form and I want use the method reset()
for reinsert the default values, I notice that after a research, for
the method reset(), the default values aren't more that first time loaded
in the form but that of the form set for the search (I think so);

see that the form is inner the same result's page, pheraphs
the reset() 'see' how default values only the last form and not those
that is loaded initially;

is there some tip?
Please stop posting identical queries. In the run of a couple of days
you have posted four nearly identical queries:

memorize form settings
http://groups.google.com/group/comp....a6221ff7eb4e27

memorize all form's setting
http://groups.google.com/group/comp....ecc3c9df98ef78

regards method reset()
http://groups.google.com/group/comp....8318271cfc1148

problem with method reset()
http://groups.google.com/group/comp....9de1d38692ce5e
That creates broken threads all around: please choose one - possibly
this one - where you will be collecting answers and providing extra
info if asked.

For the question itself it was clearly answered in the very first
thread: use reset().
If reset doesn't work for you than you don't want to restore form's
default values but you are willing to do something else what you
failed to express so far.
Jun 27 '08 #3

P: n/a
Method reset() will set all values back to what it was ON page LOAD,
so if you want it to behave the way you describe (if I understand it
correctly) you can:
1) provide your own reset() function
example code
<input type="..." defaultValue="..." value="..." />
...
<input type="reset" onclick="myReset()" ... />
in you function take values from defaultValue attribute and assign it
to value attribute..
problem is that first time I load page I achieve default value with
javascript;
but when I click submit for make search, also the file
javascript is reload so I haven't more my defalut value;
is possible to have static variable in javascript?

2) if you DO NOT want to override the reset() function you can load
the page with default values and set current (search specific) values
in onLoad script, then std reset() will work the way you want...
can explain better?
thanks
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.