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

Pick value in dropdown combo on WebBrowser page

How do I programmatically set the value picked in a drop down? So,
let's say that I have a dropdown that has three possible values:
"Car", "Truck", and "Bicycle". What code would I use to set the picked
value to, for example, "Car"?
Jun 27 '08 #1
2 1698
On Jun 5, 1:38 pm, BobRoyAce <b...@omegasoftwareinc.comwrote:
How do I programmatically set the value picked in a drop down? So,
let's say that I have a dropdown that has three possible values:
"Car", "Truck", and "Bicycle". What code would I use to set the picked
value to, for example, "Car"?
selectbox.value = corresponding_value_for_your_selection (as in
<option value="...">Car</option>)
Jun 27 '08 #2
On 5 Jun., 14:38, BobRoyAce <b...@omegasoftwareinc.comwrote:
How do I programmatically set the value picked in a drop down? So,
let's say that I have a dropdown that has three possible values:
"Car", "Truck", and "Bicycle". What code would I use to set the picked
value to, for example, "Car"?
Since

selectRef.value = "Car";

is not going to work everywhere:

var i = 0;
selectRef.selectedIndex = i;

How to obtain `i' for the general case is left as an exercise to the
reader.

http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-94282980
PointedEars
Jun 27 '08 #3

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

Similar topics

1
by: OhFiddleSticks | last post by:
Does anyone know if there is a way to add a text value to a combo box (the text box part, not the rowsource) in VBA without triggering an update event? I've tried everything I can think of without...
6
by: Rey | last post by:
Howdy, all. Appreciate your help. Have a one to many relation between a client and visit table. In the visit subform, I have a visittype and counselor field which are comboboxes. If I set...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
0
by: Raja | last post by:
I have an .aspx form with Microsoft Tab on it.There are about 4 Tabs with each one having a Dropdown List.When the page is loaded it fetches value from the database and Sets the value as selected...
6
by: Tan | last post by:
Hello Everyone Need help! I have a object with the integer property that represent the address type. I like to show a combo box in the grid linked to an object data source displaying the...
2
by: Scott | last post by:
If I click the "Update" button on my form below, I can retrieve the value of my combo by using code in the FORM RESULTS section below. Therefore, if I choose the "Inside" option in my combo, I...
1
by: Alex | last post by:
Hi Everyone -- I have two tables, one has a list of Items and one a list of Bidders. I'm creating a Form to allow the user to select the Bidder Name from a dropdown list. I want the Bidder Name...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
The code below goes into the dropdown event handler for a standard combo box. It makes the dropdown as wide as the widest text entry. Unfortunately, this combo box is on the right edge of the...
4
benchpolo
by: benchpolo | last post by:
I have a dropdown combo "TaxYear" with 2 fields Autonumber, Year. When data are entered in form the value that displays in the dropdown combo are Year, but when i assign the me.year.value to a...
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: 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...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
0
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,...

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.