title: JavaScript, HTML, JSP onClick statement
body: <p>Is there a way to use the value from a text field as the parameter value in an onclick statement for a button. For example if you have some text field named "name" and you have another button named "button" when clicked will go to the same page "page.jsp" with a parameter "par" equal to the text field value. This is what I am currently doing:</p>
  
  <pre><code>out.print("&lt;input type = 'button' name = 'noName' value = 'Click Me' onclick =" + '"' + "window.location.href = 'http://page.jsp?par=" + document.form.name.value + "'" + '"');
  </code></pre>
  
  <p>But for some reason it doesn't like the <code>par=" + document.form.name.value</code></p>
  
  <p>Any suggestions? </p>