Anyname Donotcare Anyname Donotcare - 2 years ago 201
HTML Question

How to pass the text box value as a part of href

I try to pass text box value as a part of link

query string like this :

<asp:TextBox ID="txt_reg" runat="server"></asp:TextBox>

<a target="_blank" href="Schedule.aspx?nav=<%=txt_reg.Text %>" >ENTER</a>

But i get no value in
parameter !

What should i do to pass the textbox value as a part of link ?

Answer Source

Try this

<input type=text id=txt_reg />

 <a target="_blank" href="" onclick="this.href='Schedule.aspx?nav='+document.getElementById('txt_reg').value" >ENTER</a>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download