Quantcast
Channel: YUILibrary.com :: Form
Viewing all articles
Browse latest Browse all 27

Re: Which validators built in?

$
0
0
Where can I find a list of builtIn validators that already exist?

If isNumber isn't already provided it would be nice to have, especially if it could deal with locale differences (France use the comma as the decimal period as well as for the thousands delimiter I believe).

The very simple check I have used is:

function validateNumericInput (val) {
if (!isNaN(parseFloat(val)) && isFinite(val) && (val > 0) && (val != '')) {
return true;
} else {
amount_to_borrow.set('error', 'Please enter a valid number > ');
return false;
}

}

But I'm finding that maybe a field event isn't triggered if a value isn't entered, so the val != '' is redundant.

How do I get Form to validate for "required" fields?

TIA,
Nick

Viewing all articles
Browse latest Browse all 27

Trending Articles