I have a form that I want to create whereby the user enters in one digit per text box. I need all those digits to be correct when the user clicks a button - imagine the iPhone Passcode lock feature.
Ideally I'd like the button only to be clickable when all the digits are correct (perhaps with a variable I define) - otherwise it doesn't perform an action.
HTML -
<form id="journey">
<input name="code1" type="text" class="code onlyNumeric" maxlength="1" />
<input name="code2" type="text" class="code onlyNumeric" maxlength="1" />
<input name="code3" type="text" class="code onlyNumeric" maxlength="1" />
<input name="code4" type="text" class="code onlyNumeric" maxlength="1" />
<input name="code5" type="text" class="code onlyNumeric" maxlength="1" />
<input type="button" class="button" value="Next location" />
</form>
At the moment I'm seeing if I can use this with jQuery/Javascript but am unsure how to go about this.
I'd really appreciate some help with this. Thank you.