سؤال

How can I know in my template file: node-object.tpl.php that form falis on validation.

I want to use this because form is in hidden div and when I know that validation fails I can pre-open that div.

Thx.

هل كانت مفيدة؟

المحلول

You can use jquery on the client side to check for validation and you can use a module to get server side validation done.

Jquery will be fast and user friendly and server side validation will make sure the submission is safe and no cross side scripting hacks are done.

Further research to get your work done:

1) Search for hook_form_validate() function in d7. This is a simple function which will do the validation for you.

2) Check out http://drupal.org/project/clientside_validation for client side validation.

If you still need more help then pls revert.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top