473,387 Members | 1,342 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,387 software developers and data experts.

Force all select boxes on page to default?

I have a form with about 40 select boxes that are pre selected with
selections based on some passed data. What is a quick and easy way to
have a link on the page where when I click on it, it forces ALL of the
select boxes back to their default state selecting the first option in
the list which has a value of "" and the display value is "SELECT". I
basically want to reset them all.

??

THANKS

Feb 20 '07 #1
2 1333
Erich93063 wrote:
I have a form with about 40 select boxes that are pre selected with
selections based on some passed data. What is a quick and easy way to
have a link on the page where when I click on it, it forces ALL of the
select boxes back to their default state selecting the first option in
the list which has a value of "" and the display value is "SELECT". I
basically want to reset them all.
s=document.getElementsByTagName("select");ss=s.len gth;
while(ss--)s[ss].options[0].selected=true;
Mick
Feb 20 '07 #2
On Feb 20, 11:33 am, Michael White <m...@mickweb.comwrote:
Erich93063 wrote:
I have a form with about 40 select boxes that are pre selected with
selections based on some passed data. What is a quick and easy way to
have a link on the page where when I click on it, it forces ALL of the
select boxes back to their default state selecting the first option in
the list which has a value of "" and the display value is "SELECT". I
basically want to reset them all.

s=document.getElementsByTagName("select");ss=s.len gth;
while(ss--)s[ss].options[0].selected=true;
Mick
AWESOME! Worked perfectly. Thanks!

Feb 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Matt | last post by:
In ASP page, there is a "SELECT ALL" button, when user click it, it will select all checkboxes. I am not sure should I use client-side code to do that? the following is my approach but it didnt...
7
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
4
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false...
5
by: Allan M. | last post by:
I have a series of select boxes that must be populated client side, because they interact with each other. The design specification calls for these boxes to be updated without having to make a...
5
by: Mike L | last post by:
If a newer version of the application exist, the user will receive a popup question that states, "Update Available. Application update. A new version of projectname is available. Do you want to...
2
by: cottonj | last post by:
is there anyway to force an event, like mouseover? I have a page that loads, and due to some complex js code (not mine) it fails to write labels to tabs until the user does a mouseover on the...
2
by: abracad_1999 | last post by:
I would like to create a form in which a 2nd select box appears depending on the value selected in the 1st select box. The values of the 2nd select box will come from a database. My question is...
3
by: e | last post by:
I have a form which includes a list box populated with items from a query. When a user double clicks on a row in the list box, each column item is put into a specific text box. The problem...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.