473,378 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem with method reset()

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
3 1697
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Claire | last post by:
Hello, I am having a problem in my struts application with the checkboxes in my form. I have an array of checkboxes, some of which may be already selected when the form loads. My problem is when...
0
by: farooq | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable...
1
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable...
2
by: Roger Withnell | last post by:
I need to reset a form to its original value using onclick rather than the Reset button. So, I have: <input type="button" name="reset" id="reset" value="Reset" onclick="form1.reset();"> where...
0
by: anandv81 | last post by:
Hi, I encountered a strange problem while working on an application, the problem goes like this. I am generating a few textboxes at runtime at the server side and added to a placeholder, a...
10
by: jaxent | last post by:
Does anyone know why IE gives the error "'document.myForm.dummy' is null or not an object" on the following page? Firefox does what I expect, creates a text box and writes "hello" in it. <html>...
0
by: Vash10 | last post by:
I have two asp files. Login.asp and changePass.asp. what i want to do is to make the user change his password after his first login. so what happens is login.asp is the first to be used then it is...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
5
by: xirowei | last post by:
public class Result { private int countA = 0; private int countB = 0; private int statement; private boolean statusA = false; private boolean statusB = false; private int arrayA = new...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.