I have a button in a JSP which, when pressed, makes a GET request to a servlet.
The following is the link, and it works fine, calling the servlet and correctly passing the id parameter.
<a id="sButton" href="javascript:perform('editShow(/auth/mkt/mgmt/save?id=1)');">
</a>
I need to add another parameter to the GET request. This will be the value entered by the user in an input box, which has an id of newPrefix. I understand that the following JQuery will retrieve the value:
$('#newPrefix').val()
The question is, how to incorporate the above into the HREF.
I have tried the following
<a id="sButton" href="javascript:perform('editShow(/auth/mkt/mgmt/save?newPrefix=$('#newPrefix').val()&id=1)');">
</a>
But this fails. The servlet method is called, but the parameters are not passed correctly.
newPrefix is received as $('
id is received as null
What is the correct way to get the value of the input box within the HREF ?
Thanks