Form Object Select/Option
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aaron_Keane
Posted On:   Monday, September 3, 2001 02:21 AM

Hi, I am using JScript to post a users product selections to my shopping cart. Owing to the nature of the products that we are selling the user has an option of building a particular item based on the product attributes, which are displayed in Form Select Drop Down boxes. For all of the other types of form poobjects I can access the values using form.objectname.value for example for a checkbox in one of the forms I can access it using if(eval("OrderItemAddForm"+i).checkbox.checked) However I am noyt to sure how to access the users selected option in the form. If any one can offer assistance as to how exactley this the correct option in the selct box can be identified, it would be of great    More>>

Hi,


I am using JScript to post a users product selections to my shopping cart. Owing to the nature of the products that we are selling the user has an option of building a particular item based on the product attributes, which are displayed in Form Select Drop Down boxes.


For all of the other types of form poobjects I can access the values using form.objectname.value for example for a checkbox in one of the forms I can access it using

if(eval("OrderItemAddForm"+i).checkbox.checked)

However I am noyt to sure how to access the users selected option in the form.

If any one can offer assistance as to how exactley this the correct option in the selct box can be identified, it would be of great assistance.



Thanks in advance.

Aaron

   <<Less

Re: Form Object Select/Option

Posted By:   Anonymous  
Posted On:   Tuesday, September 4, 2001 11:26 PM

You can check for the selected item as follows:
var x = formname.selectname[formname. -selectname.selectedIndex].value
this will give you the value.
If you want to get the displayed text in the select
instead of 'value' above use 'text'
Hope this solves your problem.
Any questions are most welcome
About | Sitemap | Contact