I am trying to submit the form without clicking on SUBMIT button. I want to do it without javascript. Is there any way that I can achieve it? I want to get data in jsp from servlet using scriplets but how can I achieve it?
Firstname: Tom
Lastname: Jerry
index.jsp
<form action="NewServlet" method="post">
<input type="text" name="firstname"/>// while entering Tom here Jerry
should appear automatically in below text box
<input type="text" name="lastname"/>//I am trying to display Jerry while
user enters Tom on above text box
</form>
NewServlet.java
String firstname=request.getParameter("firstname");
if(firstname.equals("Tom"){
String lastname="jerry";// return this value "Jerry to index. jsp
request.setAttribute("lastname", lastname);
}