Anyname Donotcare Anyname Donotcare - 10 months ago 118
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 ?


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>