Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

How i can use getElementById

in a loop of combobox ( select statemnets)

Posted
Updated 24-Nov-09 4:32am
v2

Do you mean how do you select the items in the combobox ? You'd need to give them an id, obviously.
 
Share this answer
 

What do you mean ? Where do you want to 'remember the choice' ? You put an attribute in each item which is called id and stores an id.  Of course, you'd need to remember the id, so why not just remember the selection ? What exactly are you trying to do ?

 
Share this answer
 

I have a list of products, beside each product i have a select option to choose how many of a product we want to buy, then i need an invoice with the total amoney i have to pay. so i don't know how to save the choice that the user choose from this select

 
Share this answer
 

"I have a list of products, beside each product i have a select option to choose how many of a product we want to buy, then i need an invoice with the total amoney i have to pay. so i don't know how to save the choice that the user choose from this select "

Well, if you do a postback, then that selection is visible.  Or if you're making many selections before you postback, you can store them in a hidden field, for example, and read that on postback.  Is this for homework ?

 
Share this answer
 

yes I don't know how to give them an ID

can u plz give me an example

I have a loop from <select> that i bring them from a database, i want to remeber the choice and they told me by getElementById

 
Share this answer
 

:)))

Yes it is a homework, and it is not working with me, we can use PHP and javascript

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900