jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › Validator, Drag & Drop, Sortable › What actions are available for rule?
This topic contains 2 replies, has 3 voices, and was last updated by alastairwalker 8 years, 7 months ago.
-
Author
-
Hi there. What all actions can you use for jqxValidation rules? I don’t see a list in the API.
Is there an ‘errorpanel’ sort of variant on this, where we can place error messages that come from the server? These shouldn’t cause validation to actually fail, just ‘appear’ to fail. When I resubmit the form, I want the client validations to fire, and to ignore these ‘server’ messages – if the error still exists, the server will notify me, there’s no need to have the client block my resubmitting it.
I saw the example you provided about server error messages, and this is too fine-grained and simple for my purposes. There are many reasons a validation might fail, and you can’t see what all the reasons are by submitting the ‘birth date’ field to a special AJAX routine, for instance.
Big big picture overview – the server errors are the most important. If I code only one set of validations, it would be server side, to protect data integrity. I want the server errors to ‘look’ like the client-side errors, but not block validation, because the server will be handling that.
If I’m ambitious, I’ll code two sets of validations – one for client side, and one for server side – but I would still need them to look the same.
Thanks!
Hi Kamilche,
“action” could be any DOM event. You can implement server validation with custom validation rule function. See: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/registration_form.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Following-up from the question raised above, I am trying to relate the actions in the API documentation (i.e. ‘blur’) with javascript events i.e. the list below, as a sample:
onblur – When a user leaves an input field
onchange – When a user changes the content of an input field
onchange – When a user selects a dropdown value
onfocus – When an input field gets focus
onselect – When input text is selected
onsubmit – When a user clicks the submit button
onreset – When a user clicks the reset button
onkeydown – When a user is pressing/holding down a key
onkeypress – When a user is pressing/holding down a key
onkeyup – When the user releases a key
onkeyup – When the user releases a key
onkeydown vs onkeyup – BothTo use a js event like ‘onblur’ do I simply write the action part of the rule as
action: onblur
It is not clear how the js actions are mapped to the Validation references i.e. how ‘blur’ is mapped to ‘onblur’.
An explanation will be helpful.
Many thanks,
Alastair Walker
-
AuthorPosts
You must be logged in to reply to this topic.