okay, first you want to limit the length of the input to the desired number of digits:
<input type="text" name="license" maxlength="10">
- set
maxlength
to the number you need.
http://www.w3schools.com/tags/att_input_maxlength.asp
with this code (jquery - put it in your themes/theme_folder/js/functions.js - and make sure you are calling the jquery files and this js file in the front end) you can limit the input to only numerals, backspace, and delete:
$(document).ready(function() {
$("#txtboxToFilter").keydown(function(event) {
// Allow only backspace and delete
if ( event.keyCode == 46 || event.keyCode == 8 ) {
// let it happen, don't do anything
}
else {
// Ensure that it is a number and stop the keypress
if (event.keyCode < 48 || event.keyCode > 57 ) {
event.preventDefault();
}
}
});
});
since this is technically not password protecting you could leave it at this, and just make this a required field to proceed to the next page.
although if you do have an actual password you can just use jquery .text(); to change it to that password when you click on submit:
$('#submit').click(function(){
$("#txtboxToFilter").text("0123456789");
});
http://api.jquery.com/text/
if this solves your problem or if it helped you please mark it as an answer