Web Analytics Made Easy -
StatCounter how to use selectbox data on the same page - CodingForum

Announcement

Collapse
No announcement yet.

how to use selectbox data on the same page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use selectbox data on the same page

    i want to use the selected data of a select box in the same page where the select box is how can i use javascript to do the same can anyone help me on this.

    cheers, Murthy.

  • #2
    bit of an open question

    A SelectList has options

    each option may have a value and text

    <option value="Fred" >The Text Fred</option>

    the specific option vale and text can be establish on an onchange event by examining the selectedIndex option value and or text

    MyValue=obj.options[obj.selectedIndex].value;
    MyText=obj.options[obj.selectedIndex].text;

    where obj is the SelectList object

    alternatively the values and text can be recorded in an array

    and used as global variables for any other requirements on the page

    If you post a specific requirement, can help more.
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

    Comment

    Working...
    X