Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can we modify the form validation of drupal?

Answer Posted / Geetanjali

In Drupal, you can customize form validation by implementing the hook_form_alter() in your custom module. This hook allows you to alter existing forms or create new ones. To validate a form, you should implement the hook_form_validate() inside your custom module. Here is an example of how it looks:nn```phpnfunction MYMODULE_form_alter(&$form, &$form_state, $form_id) {n if ($form_id === 'my_custom_form_id') {n // Add custom validation rules.n n }n}nnfunction MYMODULE_form_validate($form, &$form_state) {n // Perform validation checks.n}n```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create custom table using drupal module?

123


Did you contributed the drupal site (any module)?

102


How will you create a field using code?

118


What is the drupal current version?

147