How do I get the value of a select list with '[]'

Discussion in 'JavaScript' started by Betty_S, Feb 12, 2007.

  1. #1
    Hi 2 U all

    I have a <select> with no id, and its names is "sltc1[]".
    I want to retrieve its selection,
    I tried "document.form1.slct1.value" or "document.form1.slct1[].value" but faild.
    How do I get the value?

    TKS In Advance.
     
    Betty_S, Feb 12, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Try this: document.form1.slct1[document.form1.slct1.selectedIndex].value
     
    ajsa52, Feb 12, 2007 IP