I have been asked for a very short simple project to allow the magnetic stripe of an ID card to be read, and display the result from a database if dues are paid or not paid.
I have all this working and am trying to remove some annoying behaviors. The magnetic strip information is being captured in a form with a single input text field. The user must click on submit to proceed to a second hidden page where I parse out the information and assign to variables, preparing for the database search.
I would like to remove the requirement that the user has to press the submit button. It seems that I should be able to trigger off the length of the input variable being greater than 0.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
. .
<body onload = document.get_id.fID_Num.focus();>
. .
<form id="get_id" name="get_id" method="post" action="card_swipe_process.asp">
<table width="100%" border="5" cellpadding="2">
<tr>
<td width="45%" class="PIN_LABEL">Swipe ID Card</td>
<td width="10%"> </td>
<td width="45%"><label for="fID_Num"></label>
<input name="fID_Num" type="text" id="fID_Num" maxlength="15" /></td>
</tr>
<tr>
<td class="PIN_LABEL"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="PIN_LABEL"> </td>
<td> </td>
<td><input type="submit" name="ID_NUM_ENTER" id="ID_NUM_ENTER" value="Submit" /></td>
</tr>
</table>
</form>