##Background##
i am a complete noob with JS (i can slightly read it, but cant write it)
##Problem##
Link:
http://s328792954.websitehome.co.uk//multi_step_form/
Im trying to make a multi-step form,
and i cam across a tutorial on-line which showed a basic example.
anyway.....
i've added a field for number only (loan amount)
but the coding i use is obviously wrong because now it will not accept any form of input
Code:
var fields = $('#first_step input[type=amountborrow]');
var numericExpression = /^[0-9]$/;
var error = 0;
fields.each(function(){
var value = $(this).val();
if( value.length<3 || value==field_values[$(this).attr('id')] || ( $(this).attr('id')=='amountborrow' && !numericExpression.test(value) ) ) {
$(this).addClass('error');
$(this).effect("shake", { times:3 }, 50);
error++;
} else {
$(this).addClass('valid');
}
});
please help (sorry if this is wrong section i didnt really understand forum sections)