Get text from SELECT into hidden text?

Discussion in 'ASP General' started by Marco Krechting, Jan 9, 2005.

  1. Hi All,

    I have a thing that I can't get to work.
    I have a SELECT box of which I want the text to be copied to a hidden text.

    <SELECT NAME="GetUser" SIZE="1" >
    <option> --- Select your Username ---
    <option>
    <% Do while NOT rs.EOF %>
    <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    <%
    rs.MoveNext
    loop
    %>
    </select>

    Now I want to copy the text in the Select box into the hidden field so it
    can be posted to another form.

    <input type="hidden" name="psmUser" value= form.GetUser.text size="50">

    Any ideas?

    Marco
     
    Marco Krechting, Jan 9, 2005
    #1
    1. Advertising

  2. Marco Krechting

    Bob Lehmann Guest

    Why aren't you just posting the selected item?

    Why are you giving everybody half the answer, assuming this is a login of
    some sort and you also have a password, to everybody?

    Bob Lehmann


    "Marco Krechting" <> wrote in message
    news:69e12$41e1bc88$3e3af2ad$...
    > Hi All,
    >
    > I have a thing that I can't get to work.
    > I have a SELECT box of which I want the text to be copied to a hidden

    text.
    >
    > <SELECT NAME="GetUser" SIZE="1" >
    > <option> --- Select your Username ---
    > <option>
    > <% Do while NOT rs.EOF %>
    > <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    > <%
    > rs.MoveNext
    > loop
    > %>
    > </select>
    >
    > Now I want to copy the text in the Select box into the hidden field so it
    > can be posted to another form.
    >
    > <input type="hidden" name="psmUser" value= form.GetUser.text size="50">
    >
    > Any ideas?
    >
    > Marco
    >
    >
     
    Bob Lehmann, Jan 10, 2005
    #2
    1. Advertising

  3. Marco Krechting wrote:
    > <SELECT NAME="GetUser" SIZE="1" >
    > <option> --- Select your Username ---
    > <option>
    > <% Do while NOT rs.EOF %>
    > <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    > <%
    > rs.MoveNext
    > loop
    > %>
    > </select>
    >
    > Now I want to copy the text in the Select box into the hidden field
    > so it can be posted to another form.
    >
    > <input type="hidden" name="psmUser" value= form.GetUser.text
    > size="50">


    You mean like this?

    <SELECT NAME="GetUser"
    ONCHANGE="document.otherform.psmUser.value=this[this.selectedIndex].text">


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jan 10, 2005
    #3
  4. Uh, why don't you just make them type their username in, and post it like
    normal people do?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Marco Krechting" <> wrote in message
    news:69e12$41e1bc88$3e3af2ad$...
    > Hi All,
    >
    > I have a thing that I can't get to work.
    > I have a SELECT box of which I want the text to be copied to a hidden

    text.
    >
    > <SELECT NAME="GetUser" SIZE="1" >
    > <option> --- Select your Username ---
    > <option>
    > <% Do while NOT rs.EOF %>
    > <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    > <%
    > rs.MoveNext
    > loop
    > %>
    > </select>
    >
    > Now I want to copy the text in the Select box into the hidden field so it
    > can be posted to another form.
    >
    > <input type="hidden" name="psmUser" value= form.GetUser.text size="50">
    >
    > Any ideas?
    >
    > Marco
    >
    >
     
    Aaron [SQL Server MVP], Jan 10, 2005
    #4
  5. Sorry,

    I cant follow you.

    Marco

    "Bob Lehmann" <> wrote in message
    news:...
    > Why aren't you just posting the selected item?
    >
    > Why are you giving everybody half the answer, assuming this is a login of
    > some sort and you also have a password, to everybody?
    >
    > Bob Lehmann
    >
    >
    > "Marco Krechting" <> wrote in message
    > news:69e12$41e1bc88$3e3af2ad$...
    >> Hi All,
    >>
    >> I have a thing that I can't get to work.
    >> I have a SELECT box of which I want the text to be copied to a hidden

    > text.
    >>
    >> <SELECT NAME="GetUser" SIZE="1" >
    >> <option> --- Select your Username ---
    >> <option>
    >> <% Do while NOT rs.EOF %>
    >> <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    >> <%
    >> rs.MoveNext
    >> loop
    >> %>
    >> </select>
    >>
    >> Now I want to copy the text in the Select box into the hidden field so it
    >> can be posted to another form.
    >>
    >> <input type="hidden" name="psmUser" value= form.GetUser.text size="50">
    >>
    >> Any ideas?
    >>
    >> Marco
    >>
    >>

    >
    >
     
    Marco Krechting, Jan 10, 2005
    #5
  6. He's suggesting just naming the <SELECT> element psmUser and ditching the
    <input type=hidden> altogether.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Marco Krechting" <> wrote in message
    news:ba2cc$41e2196c$3e3af2ad$...
    > Sorry,
    >
    > I cant follow you.
    >
    > Marco
    >
    > "Bob Lehmann" <> wrote in message
    > news:...
    > > Why aren't you just posting the selected item?
    > >
    > > Why are you giving everybody half the answer, assuming this is a login

    of
    > > some sort and you also have a password, to everybody?
    > >
    > > Bob Lehmann
    > >
    > >
    > > "Marco Krechting" <> wrote in message
    > > news:69e12$41e1bc88$3e3af2ad$...
    > >> Hi All,
    > >>
    > >> I have a thing that I can't get to work.
    > >> I have a SELECT box of which I want the text to be copied to a hidden

    > > text.
    > >>
    > >> <SELECT NAME="GetUser" SIZE="1" >
    > >> <option> --- Select your Username ---
    > >> <option>
    > >> <% Do while NOT rs.EOF %>
    > >> <option value="<%= rs("EmailAddress")%>" ><%=rs("User")%></option>
    > >> <%
    > >> rs.MoveNext
    > >> loop
    > >> %>
    > >> </select>
    > >>
    > >> Now I want to copy the text in the Select box into the hidden field so

    it
    > >> can be posted to another form.
    > >>
    > >> <input type="hidden" name="psmUser" value= form.GetUser.text size="50">
    > >>
    > >> Any ideas?
    > >>
    > >> Marco
    > >>
    > >>

    > >
    > >

    >
    >
     
    Aaron [SQL Server MVP], Jan 10, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    440
  2. Rick
    Replies:
    3
    Views:
    8,193
    Alexey Smirnov
    Apr 13, 2010
  3. palmiere
    Replies:
    1
    Views:
    411
    Erwin Moller
    Feb 9, 2004
  4. calfliu
    Replies:
    6
    Views:
    139
    Michael Winter
    Feb 25, 2004
  5. SolarCanine
    Replies:
    2
    Views:
    288
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page