can't get value from select box! Help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharon

    can't get value from select box! Help!

    Hello,
    Why is it that I do get the value from my text box but I cannot get
    the value from my select box which is located in the same form? This
    is the code I use:

    var text1 = frmMain.filter1 txt.value;
    var sel1 = frmMain.filter1 sct.options[frmMain.filter1 sct.selectedInd ex].value;


    <form name="frmMain">
    <table align="center" id="Table1" width="600px"">
    <tr>
    <td>
    <SELECT NAME="Filter1sc t">
    <OPTION VALUE="fclient" >client</OPTION>
    <OPTION VALUE="fid">sle utelveld</OPTION>
    <OPTION VALUE="fusernam e">username</OPTION>
    <OPTION VALUE="fname">n aam</OPTION>
    <OPTION VALUE="fcity">w oonplaats</OPTION>
    <OPTION VALUE="fdebno"> debiteurnr</OPTION>
    </SELECT>
    </td>
    <td>
    <input type="text" name="filter1tx t" value="All"><br >
    </td>
    </tr>
    </table>
    </form>

    Hope someone can help me, thanks a lot! Sharon
  • Stephen Chalmers

    #2
    Re: can't get value from select box! Help!


    "Sharon" <esdeees@hotmai l.com> wrote in message
    news:2b13d59b.0 405240136.38b18 302@posting.goo gle.com...[color=blue]
    > Hello,
    > Why is it that I do get the value from my text box but I cannot get
    > the value from my select box which is located in the same form? This
    > is the code I use:
    >
    > var text1 = frmMain.filter1 txt.value;
    > var sel1 =[/color]
    frmMain.filter1 sct.options[frmMain.filter1 sct.selectedInd ex].value;[color=blue]
    >
    >
    > <form name="frmMain">
    > <table align="center" id="Table1" width="600px"">
    > <tr>
    > <td>
    > <SELECT NAME="Filter1sc t">
    > <OPTION VALUE="fclient" >client</OPTION>
    > <OPTION VALUE="fid">sle utelveld</OPTION>
    > <OPTION VALUE="fusernam e">username</OPTION>
    > <OPTION VALUE="fname">n aam</OPTION>
    > <OPTION VALUE="fcity">w oonplaats</OPTION>
    > <OPTION VALUE="fdebno"> debiteurnr</OPTION>
    > </SELECT>
    > </td>
    > <td>
    > <input type="text" name="filter1tx t" value="All"><br >
    > </td>
    > </tr>
    > </table>
    > </form>
    >
    > Hope someone can help me, thanks a lot! Sharon[/color]


    var sel1 =
    frmMain.filter1 sct.options[frmMain.filter1 sct.selectedInd ex].value;

    <SELECT NAME="Filter1sc t">

    You should be getting the error: "frmMain.filter 1sct.options" is not an
    object

    It's a classic case of incorrect case.

    --
    S.C.


    Comment

    • Sharon Steringa

      #3
      Re: can't get value from select box! Help!

      Well, actually, I found another error and now it's working properly...
      The thing was that first I let users select the column they want to
      filter from the select box and then fill in the value on which they want
      it to be filtered. So the focus shifts from the select box to the text
      box. When I just use
      frmMain.filter1 sct.value;
      I actually get the right result. Thanks anyway!!! Sharon


      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...