uniform-team / Uniform-Validation-Language

A logic language to simplify and improve online form validation.
Apache License 2.0
1 stars 0 forks source link

Add Standard Library #2

Open dgp1130 opened 8 years ago

dgp1130 commented 8 years ago

It would be beneficial to have some rules that are automatically added to any Uniform script to make things easier. This might include:

@filled: /"."/;
@today: <today's date>
@now: <today's time>
$("input[type='text'], select, input[type='date'], ") {
    valid: this matches @filled;
}

These would make it a default assumption that a text box, select box, and date input are all valid if they have some text in them. It would also expose a few variables such as a @filled regex as well as today's date and the current time. Other defaults may need to be set for other inputs.