javascript - How to pass a textbox value to another jsp page via <a href tag -


in above jsp trying pass text box value through href tag. came across above syntax in stackoverflow. not seem working. need help.

html

<input id="ordereditems" type="text" name="ordereditems" value="hiii" />  <a href='products.jsp?id=1&loginid=${username}&orderim='+ document.getelementbyid('ordereditems').value;> 

you should change href attribute in onchange event of input.

example

var link = document.getelementbyid("link"),     txt = document.getelementbyid("txt"),     baseurl = link.href;  txt.onchange = function() {     link.href = baseurl + "?param=" + this.value; }; 

Comments