php - Drupal 6 Validation for Form Callback Function -


On my node display page there is a simple form with a selection menu: Is there a simple way to validate the form in my callback function The easiest way? By verification, to find out that the advanced value appears in any form, in fact the value is present in the array. For example, without AJAX, if there are 3 items in my selection menu and I add 4th item and try to submit the form, then Drupal will say an error that "An illegal election was made, please admin contact them."

With AJAX, you have saved this 4V item in the database. So do I have to write

  like verification (if $ select_item> 0 & amp; amp; $ select_item & lt; = 3) {// insert in db}  

Or is there an easy way to ensure that the item actually exists in the form array? I am hoping that without Ajax, the droplet will not submit the form if it has been tampered with. Thank you.

Edit: So why do I need this in the original callback function?

  $ form_state = array ('storage' = & gt; NULL, 'plus' = & gt; wrong); $ Form_build_id = $ _POST ['form_build_id']; $ Form = form_get_cache ($ form_build_id, $ form_state); $ Algs = $ form ['# parameter']; $ Form_id = array_shift ($ args); $ Form_state ['post'] = $ form ['# post'] = $ _POST; $ Form ['# programmed'] = $ form ['# redirect'] = FALSE; Drupal_process_form ($ form_id, $ form, $ form_state);  

['form_build_id'] to get $ _POST, I sent it as the ultimate data, right? Where I use form_get_cache, it seems that there is no data lost in the way it is now lost.

You are already using AJAX, why not just write a bit of jQuery if the option Is there a permit permission for submitting submissions? This can be done within a custom module that already shows that you are working (using drupal_add_js ()).


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -