473,666 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1346
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.getE lementsByTagNam e("select");ss= s.length;
while(ss--)s[ss].options[0].selected=true;
Mick
Feb 20 '07 #2
On Feb 20, 11:33 am, Michael White <m...@mickweb.c omwrote:
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.getE lementsByTagNam e("select");ss= s.length;
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
8414
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 work. <script language="JavaScript"> function selectAllCheckBox() { //alert(document.addzone.c1.value); document.addzone.c1.value = "on"; } </script>
7
3509
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 in a list box and submits the form the value is put into a session variable and the relevant page is displayed (in accordance to one of the list boxes). The page is then displayed with the relevant SQL data. So far i have got the
12
6533
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 courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
4
21000
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 with a line such as: onchange="return(confirm('proceed Yes or No')))" but it always stops the change.
5
2131
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 roundtrip to the server. The codebehind seems to be unaware of select box members populated via javascript. So, I'm having to create my own state management solution, (i.e. rewriting the VIEWSTATE mechanism) to persist the state of these select...
5
2772
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 download it now?" OK button and a Skip button are show on the popup question. I don't want the popup question to show up for the user. I don't see the option to disable this in the publish wizard.
2
5293
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 tabs. the page load event happens beforre the tabs are loaded. Once the user mouseovers the tabs, the labels of the tabs appear, and stay there. it is irritating. i would like to force a mouseover so the tab names appear. thanks
2
2338
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 how to create this in php? One way is to re-load the page depending on what's chosen in the first box, or alternatively to use frames or an iframe? Is there another, better way that can dynamically change the initial page?
3
3782
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 right now is that a row is already selected, and the items put into the text boxes, for all records that have been entered using the form. I don't want any row selected when I create a new record. The other problem right now is that if I select a...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8780
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.