I am using Ajax in java web application and i want to take the value of textfield along with the href link to the next page.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% String root = getServletContext().getContextPath();
%>
<table border="0" id="box-table-b">
<thead><tr>
<th height="31" colspan="2" nowrap>Enter User Id of Patient </th>
</tr></thead>
<tr>`enter code here`
<td width="76" nowrap>UserId</td>
<td width="85" nowrap>
<input type="text" name="confuserid" id="confuserid"/>
</td>
</tr>
<tr>
<td height="66" colspan="2" align="center" valign="middle" nowrap>
<a href="#" onclick="returndisplayData('<%=root%>/confapp.do?method=confapp','entry');"><input type="button" value="Submit"></a>
</td>
</tr>
</table>
You could put the control and the link in a form and submit the form via GET, but that will take you away from your ajax.
Another option would be to simply get the value of the confuserid using jQuery and append it to the URL you are passing to your returndisplayData function.
something like
then your link looks like
Obviously you would need to include jQuery in your page.