Skip to content

modify valAttr setter, to allow external scripts to set element validati... #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2013

Conversation

stevewasiura
Copy link
Contributor

...ons

allows ext javascript to set validation attributes using:

$("[name='group_id[]']:eq(0)")
.valAttr('','validate-checkbox-group')
.valAttr('qty','1-2')
.valAttr('error-msg','chose 1, max 2')
;

this is useful when dealing with a group of checkboxes generated from server-side script, and you don't need validation on all the items, just he first one. an example will be forthcoming in my next patch that adds "checkbox-group" to the validation library.

existing code base would append dash / hyphen to "data-validation" attribute, thereby rendering that attribute incorrectly, forcing need to use full jQ statement " .attr(n,v) "method.

…ations

allows ext javascript to set validation attributes using:

$("[name='group_id[]']:eq(0)")
    .valAttr('','validate-checkbox-group')
    .valAttr('qty','1-2')
    .valAttr('error-msg','chose 1, max 2')
    ;

this is useful when dealing with a group of checkboxes generated from server-side script, and you don't need validation on all the items, just he first one. an example will be forthcoming in my next patch that adds "checkbox-group" to the validation library.

existing code base would append dash / hyphen to "data-validation" attribute, thereby rendering that attribute incorrectly, forcing need to use full jQ statement " .attr(n,v) "method.
@victorjonsson
Copy link
Owner

Ah, that's a good solution!

victorjonsson added a commit that referenced this pull request Jul 23, 2013
modify valAttr setter, to allow external scripts to set element validati...
@victorjonsson victorjonsson merged commit 8fe5113 into victorjonsson:master Jul 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants