function closeDialogIfValid( dialogId ){
var invalidCount = dojo.query( '[id="' + dialogId + '"] [aria-invalid="true"]' ).length;
if( invalidCount === 0 ){
XSP.closeDialog( dialogId );
}
}
This probably only works if you're using server side validation.
If there is something like this in the XSP API, please let me know.
Share and enjoy!
6 comments:
I've been working on something similar lately and I've been using that aria-invalid="true" property for styling, but I've run into a limitation on dojo-parsed fields (such as type-ahead or name pickers). They seem to lose that property after the page (or panel, etc) refreshes. Have you seen this behavior?
I struggled with a similar issue a while back, but I can't remember how/if I resolved it.
The best place to ask for help is probably StackOverflow. I'm not doing freelance work, but if it's a question I can answer, I'll try to help on SO. :)
Hi Tommy,
Ok, that's unfortunate. If you change your mind, I don't think this will take you very long, but I do need some help and would prefer to communicate with you directly. If you could drop me an e-mail at some point I would appreciate it.
In any case, please remove my e-mail address comment from your blog so it is not posted publicly.
Thank you,
Justin
I've deleted the comment.
Post a Comment