Imagine I have the following code snippet:
<html>
<head>
<script>
function setSession()
{
var roll=document.getElementById("rollno").value;
session.setAttribute("rollno", roll);
}
</script>
</head>
<body>
<form action="process.jsp">
RollNO: <input type="text" name="rollno" id="rollno" onblur=setSession()>
Admission no <input type="text" name="anum" id="anum">
<input type="submit" value="Next"/>
</form>
</body>
</html>
I am looking for an alternative solution to setting a session attribute when input is entered into the text field before form submission. Is there another way to store this information without submitting the form?