Get text from SELECT into hidden text?

  • Thread starter Marco Krechting
  • Start date
M

Marco Krechting

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
 
B

Bob Lehmann

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
 
D

Dave Anderson

Marco said:
<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.
 
A

Aaron [SQL Server MVP]

Uh, why don't you just make them type their username in, and post it like
normal people do?
 
M

Marco Krechting

Sorry,

I cant follow you.

Marco

Bob Lehmann said:
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
 
A

Aaron [SQL Server MVP]

He's suggesting just naming the <SELECT> element psmUser and ditching the
<input type=hidden> altogether.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top