I'm pretty new to jQuery, just so you know.
I'm making a site: http://stilld.nl/brrreuk/
You can see it live, it's working bit by bit. When you scroll the little car is driving. At a certain point you'll notice that you can't scroll anymore and a form will pop up. You have to answer a question before you can scroll again.
For this validation I'm thinking of using this: http://jqueryvalidation.org/documentation/
I'm trying to get it to work, but I'm stuck because of a lack of knowledge.
What I want:
When you click the button it should check if the two inputs are a specific number. So, the top one should be 3 and the bottom one should be 10. IF the inputs are correct, it should give a message like: well done!
I hope that someone can give some advice!
I'm happy to use another script, if you have a better script for me to use in this situation.
HTML:
<form id="form_1">
<fieldset>
<p>
<input type="text" class="input_required" id="teller" name="teller" maxlength="2" class="valid" aria-invalid="false" onkeydown="return isNumber(event);" placeholder="?" onfocus="this.placeholder = ''" onblur="this.placeholder = '?'" required>
<label for="teller"> </label>
</p>
<hr noshade size=3>
<p>
<input type="text" class="input_required" id="noemer" name="noemer" maxlength="2" class="valid" aria-invalid="false" onkeydown="return isNumber(event);" placeholder="?" onfocus="this.placeholder = ''" onblur="this.placeholder = '?'" required>
<label for="noemer"> </label>
</p>
<p>
<button class="submit" type="submit" value="controleer"> Controleer </button>
</p>
</fieldset>
</form>
I can make it say that their should be a number in the input fields (check out my site). But I can't get it to check if this number is the right one...
jQuery.validator.setDefaults({
debug: true,
success: "valid"
});
var form = $( "#form_1" );
form.validate();
$( "button" ).click(function() {
alert( "Valid: " + form.valid() );
});
I'm very lost, so I hope you guys can help me out....Sorry for my english, i'm dutch.