Changeset 66


Ignore:
Timestamp:
Oct 16, 2006, 10:55:12 PM (13 years ago)
Author:
Matthew Westcott
Message:

Split postcode input into two parts, with JS to hop between them

Location:
trunk/npemap.org.uk/static/tiles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/map.html

    r60 r66  
    5858    <input type="hidden" id="returnX" name="returnX" />
    5959    <input type="hidden" id="returnY" name="returnY" />
    60     <div><input type="text" name="postcode" id="postcode" /></div>
     60    <div>
     61      <input type="text" name="postcode1" id="postcode1" size="4" />
     62      <input type="text" name="postcode2" id="postcode2" size="3" />
     63    </div>
    6164    <div><input type="submit" value="submit" /></div>
    6265  </form>
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r60 r66  
    8686                                document.getElementById('returnY').value = offsetGridY;
    8787
    88                                 document.getElementById('postcode').value = "";
    89                                 document.getElementById('postcode').focus();
     88                                document.getElementById('postcode1').value = "";
     89                                document.getElementById('postcode2').value = "";
     90                                document.getElementById('postcode1').focus();
     91                        }
     92                }
     93                document.getElementById('postcode1').onkeypress = function(e) {
     94                        var key = String.fromCharCode(window.event ? window.event.keyCode : e.which);
     95                        if (key == ' ') {
     96                                document.getElementById('postcode2').focus();
     97                                return false;
     98                        } else if (key >= '0' && key <= '9' && this.value.length == 3) {
     99                                document.getElementById('postcode2').focus();
    90100                        }
    91101                }
Note: See TracChangeset for help on using the changeset viewer.