Ignore:
Timestamp:
Mar 3, 2011, 9:51:22 AM (11 years ago)
Author:
Nicklas Nordborg
Message:

References #291: Personal information registration

Move to next input field when ENTER is pressed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/persinfo.jsp

    r1300 r1305  
    214214}
    215215
     216function goNextOnTabOrEnter(event)
     217{
     218  if (event.keyCode == 9 || event.keyCode == 13) setTimeout('goNext()', 200);
     219  return true;
     220}
     221
     222function focusOnEnter(event, inputField)
     223{
     224  if (event.keyCode == 13) setTimeout("document.forms['reggie']."+inputField+".focus()", 200);
     225  return true;
     226}
     227
    216228function gotoStep2()
    217229{
     
    580592        <td class="prompt">Case name</td>
    581593        <td class="input"><input type="text" name="caseName"
    582           size="18" maxlength="12" onblur="caseNameOnChange()"></td>
     594          size="18" maxlength="12" onblur="caseNameOnChange()" onkeypress="focusOnEnter(event, 'personalNumber')"></td>
    583595        <td class="status" id="case.status"></td>
    584596        <td class="help"><span id="case.message" class="message" style="display: none;"></span>The case (barcode) associated with this patient.</td>
     
    587599        <td class="prompt">Personal number</td>
    588600        <td class="input"><input type="text" name="personalNumber"
    589           size="18" maxlength="12" onkeyup="personalNumberOnChange()" onkeypress="goNextOnTab(event)"></td>
     601          size="18" maxlength="12" onkeyup="personalNumberOnChange()" onkeypress="goNextOnTabOrEnter(event)"></td>
    590602        <td class="status" id="pnr.status"></td>
    591603        <td class="help"><span id="pnr.message" class="message" style="display: none;"></span>(YYYYMMDDZZZZ)</td>
     
    609621      <tr>
    610622        <td class="prompt">Patient code</td>
    611         <td class="input"><input type="text" name="patientCode" value="" size="18" maxlength="12"></td>
     623        <td class="input"><input type="text" name="patientCode"
     624          value="" size="18" maxlength="12"
     625          onkeypress="focusOnEnter(event, 'familyName')"></td>
    612626        <td class="status" id="patientCode.status"></td>
    613627        <td class="help"><span id="patientCode.message" class="message" style="display: none;"></span></td>
     
    616630        <td class="prompt">Family name</td>
    617631        <td class="input"><input type="text" name="familyName"
    618           size="35" maxlength="255"></td>
     632          value="" size="35" maxlength="255"
     633          onkeypress="focusOnEnter(event, 'allFirstNames')"></td>
    619634        <td class="status" id="familyName.status"></td>
    620635        <td class="help"><span id="familyName.message" class="message" style="display: none;"></span>Keep hyphens, keep åäö, replace all special accented letters [e.g. éèü etc] with standard alphabet character.</td>
     
    623638        <td class="prompt">All first names</td>
    624639        <td class="input"><input type="text" name="allFirstNames"
    625           size="35" maxlength="255" onkeypress="goNextOnTab(event)"></td>
     640          size="35" maxlength="255" onkeypress="goNextOnTabOrEnter(event)"></td>
    626641        <td class="status" id="allFirstNames.status"></td>
    627642        <td class="help"><span id="allFirstNames.message" class="message" style="display: none;"></span>Type all names, see FamilyName comment on valid characters.</td>
Note: See TracChangeset for help on using the changeset viewer.