Form validation is the operation through which form fields are verified to contain the correct input.

learn more… | top users | synonyms (1)

0
votes
0answers
3 views

How to display validation errors to checkout panes

I am trying to validate checkout forms. I did manage to validate checkout form fields but could not display the validation errors to its specific checkout panes. Unluckily the validation for checkout ...
0
votes
2answers
29 views

Redirect to anchor after form validation in Drupal 6

I am trying to redirect user to anchor of error form field after form validation. I have such form and: $form['#validate'] = 'my_form_validate'; Then, in validation function, if the form has some ...
0
votes
1answer
46 views

How to validate webform with JavaScript?

I've got a Webform for which I need additional calculations to hidden fields. I've added a JavaScript file to the page by using drupal_add_js. And let that be the only part that works... My ...
0
votes
1answer
22 views

My form validate function will not run.

I am using Organic Groups. That module has a form where you add new members to a group. I would like to run additional validation on that form. I use hook_form_alter and can identify the form. I add a ...
3
votes
1answer
41 views

How can I validate a path used to create a page?

I'm in the process of creating my first D7 module, partly based on the tutorial found here. It's a pretty simple module that creates both a block and a page to show some content. To go a little ...
1
vote
1answer
25 views

Embedding a custom form in node.tpl.php does not trigger validation

I'm trying to render a custom form in node.tpl.php. The form is rendered properly and submit handler works. However, the validation handler is not triggered properly upon submitting. If I refresh the ...
2
votes
1answer
32 views

Form Validation: Let the comma as separator to be valid in integer field input

I'd like to let my users use separator (Comma) while entering values in an integer field such as price for instance. I know that we can alter the validation of fields with element_validate_integer ...
0
votes
0answers
31 views

How to run validation on hitting the submit button for exposed views filters. Currently it runs on first page load

I am trying to add validation errors to exposed views filters (drop down lists) in block region. However, my validation error runs on the first page load before I hit apply button. Also the ...
0
votes
0answers
15 views

How write form validation to custom content type form? [duplicate]

I am using the drupal 7 content type like my form i dont know how write the form validation to that particular form.
-1
votes
0answers
15 views

Is it possible to set integer-field maximum value dynamically?

I'm developing a form that requires input of integers. One field has a total number of people attending an event, and other fields exist to store subsets of that information (attendees under 30, ...
0
votes
3answers
69 views

How to find the default value or change state of a Drupal 8 form element?

I'm putting together a fairly complex form with Drupal 8 (currently building on beta 7). In my validation function, I need to be able to detect whether a field, which was populated with default ...
0
votes
3answers
67 views

webform select options validation unique

I need to prevent two different users from choosing the same option from a webform select options component. In the validation only validation required available, no unique validation. For example: ...
0
votes
1answer
43 views

webform validation integer value

I tried webform validation, I can validate textfield component for numeric value. However, I cannot find how to set it as integer value only. How can I validate numeric (integer) value.
0
votes
0answers
83 views

Why cURL not sending my data to salesforce?

I am using drupal form to build a contact us form. I want to send my contact us data to salesforce. My contact us form has action ...
0
votes
0answers
24 views

Customize validation on node_form

I have a created a content type in Durapl7, and now I want to customize the validation for the add form on the website. Please see attached image for what I got so far, But my main problem is ...
0
votes
1answer
49 views

How to prevent required field validation in validation function?

Issue: When create a node and node publish check box is checked, all validation should work (it's working fine). but when create a node and node publish check box is not checked , then all validation ...
0
votes
1answer
80 views

Form validation not triggered at first submit, but on second submit

I'm in the need for a extra validation on an existing drupal commerce form (commerce_cart_add_to_cart_form_##), strangely the validation function is not called on the first form submit, but on the 2nd ...
0
votes
1answer
43 views

Custom validation rules for content entity fields

So I want to store an entity_type in a string field in my content entity. Since the list of entities can change over time, I can't use a list_string field with allowed options. I don't know if ...
1
vote
0answers
64 views

Webform Custom-Field Module and validation

I am currently working on a Webform that is used to enter some rather complex finance information (think tables with sums and other weird checks). Since the styling has to be rather specific for this ...
1
vote
0answers
72 views

How to get form with errors after validation to reload within the original containing DIV

I'm very new to Drupal. I've tried to create a custom theme and edit the way comments are displayed within my nodes. All good so far apart from when my comments are submitted without a textarea filled ...
1
vote
1answer
23 views

Drupal validation for nested field element

I have written some custom validation for each element in a form. I use the following method to display errors. It automatically highlights the required fields. ...
0
votes
0answers
52 views

how to validate duplicates multiple fields drupal form registration?

$query = db_select('users_roles', 's'); $query->join('field_data_field_parent_email', 'p', 'p.entity_id = s.uid'); $query->fields('p') ...
0
votes
0answers
41 views

Limit the number of web form entries, based on a field, to a set number

I'm building a competition engine, the organisers are allowing users to submit 3 entries from the same email address. I can see that WebForms allows you to set fields to be unique, or set a number of ...
0
votes
2answers
142 views

Unset required attribute with multiple submit buttons and multistep form

I have a multistep form created with msnf for an content type. I set multiple submit buttons that each one has its own submit callback, and also i want every single button with its validation callback ...
1
vote
1answer
263 views

How can i give alphabets only validation in webform?

I can give only required and maxlength validation in webform fields , How can i give alphabets or numbers only validation in webform textfields ?? UPDATE I used hook like this :- function ...
0
votes
0answers
5 views

Drupal 6, form validation and use of a template #2 [duplicate]

Can anyone explain why my form does not validate when it's using a template file in Drupal 6? Here's the code... <?php function wdacustomForms_tellMeMore_form($form_state) { $form['#attributes'] ...
0
votes
0answers
34 views

Drupal 6, form validation and use of a template

Can anyone explain why my form does not validate when it's using a template file in Drupal 6? Here's the code... <?php function wdacustomForms_tellMeMore_form($form_state) { $form['#attributes'] ...
1
vote
0answers
121 views

Set user profile fields that are not visible on registration form

Very new to Drupal, first of all. I'm working on a custom module for user registration (we're still in Drupal 6) that I'd like to do a few things: Geocode the user-supplied zipcode to get a ...
0
votes
1answer
200 views

how to show drupal message “field is required” from webform validation

So when a webform is validated it does not sends the drupal message "X field is required", it creates only the red border around the field. how would I show the Drupal messages from triggering during ...
0
votes
1answer
79 views

webform block in a page template , inside a colorbox - validation does not show

I created a page tpl for a view where using colorbox inline i`m displacing a webform block and some additional text. My problem is that the error messages are not showing. The submission is working ...
0
votes
1answer
157 views

Drupal 7 Checking for an empty entity reference field in hook_node_validate

In checking whether a form field contains an entry, it has been typical to do something like: if (sizeof($form_state['values']['my_field'][LANGUAGE_NONE]) > 0) because an empty field would still ...
2
votes
4answers
67 views

myform_validate() and myform_submit() functions not responding

I have built a form from following examples on tutorials but neither the accompanying _validate() nor _submit() functions are responding when I submit this form. This is my codes: /** *implementing ...
0
votes
0answers
22 views

Textfields are not populated with user inputs after validation fails [duplicate]

Im facing the same problem than this guy : 6 - Form fields getting cleared off of user inputs after validation errors The difference here is that I'm not using ubercart. Also my textfields use ...
0
votes
0answers
63 views

How is a form rebuild if it fails validation?

I wondering how it is rebuild if validation fails. Say you have several inputs. Change them all and submit. A certain rule isnt validated so the form validation fails (with a form_set_error). What ...
0
votes
0answers
67 views

How to prevent to create duplicate node on clicking submit button multiple time

I am using unique_field module. If a node already created and i want to create node with duplicate title(title is selected as unique field), it work fine. But if i click on submit button multiple ...
0
votes
1answer
46 views

Remove field data in submit function

Drupal 7. On form validate, I want to: check the value of one of the form fields [field-1] based on that value, completely remove another field [field-2] together with its values, from the form If ...
0
votes
0answers
182 views

validate field using regular expression in Field validation module

I have added a text field in a content type. I'm looking to validate that field by adding a Rule using "Field Validation" module. I found few options in this module like regular expression ( Regular ...
6
votes
1answer
309 views

How to use #element_validate and #value_callback in Drupal 8

I have followed the official Form API Documentation, but this code don't work for me on Drupal 8: public function buildForm(array $form, FormStateInterface $form_state) { $form['upload'] = ...
0
votes
1answer
227 views

Custom Password validation on Drupal 7 form

I am using the Drupal Form API for a customized Login System. It has the password field which needs to be validated. We have a custom criteria of Uppercase, Lowercase, numeric and special characters ...
0
votes
0answers
93 views

URL validation issues, using valid_url

I want to validate URL's. Drupal's check, on field settings, "Validate URL", does not work appropriatelly. I perform custom validation, but there are some problems. I used idn_to_ascii in order to ...
0
votes
2answers
141 views

Email validation on Drupal 7 default form Api without installing any modules

I am using Drupal Form API to create forms. What is the way to add email address validation without having to install any separate modules? Thus I am just looking for out of the box functionality. ...
1
vote
2answers
46 views

how to do node preview validation?

It is possible to set a Submit function for Preview button in an add/edit node form. I would like to see if there is a possibility to go one step backward and validate the data to be previewed. I ...
0
votes
1answer
301 views

How to add special character validation on specific field in form registration process

I want to add a special character validation on a specfic field. Here I have my code but it does not work and there is no error. function mymodule_form_alter(&$form, &$form_state, ...
0
votes
2answers
193 views

Validation and Setting value for Multi-value fields [closed]

Consider for a content type, there is a text field with multiple values capability activated. How can I check its values by $form_state inside the Validate/Submit function? How can I set its values ...
0
votes
1answer
218 views

Preventing users from registering with xxx@yyy format email address

Drupal seems to let users register with emails like xxx@yyy I heard that this kind of email address can exist. But I want users to register with only emails like xxx@yyy.zzz Is there any way to ...
0
votes
0answers
126 views

How to override form_error in webform_validate_unique function provided by webform.components.inc

I have a Webform module provided form that will be used by anonymous users. I need to avoid duplicate submissions from the same user, but can't rely on cookies or IP address (multiple users at same ...
0
votes
1answer
68 views

Custom content type add form

I am brand new working with Drupal 7 and I am working on a professional project and I would like some help to achieve some requirements. We have some content types like associations. Authenticated ...
0
votes
1answer
412 views

Unable to set field collection field value on form validation

The question might look similar to How to form_alter fields attached to an unlimited field collection? but I am more concerned about "values not saved after custom validation" I have a field ...
0
votes
2answers
140 views

client side validation

I am new to Drupal. I am trying to enable client side validation on my web forms. I installed & enabled the modules as per the Drupal.org link: https://www.drupal.org/node/1324924 & then went ...
0
votes
1answer
212 views

Drupal 8 custom validate user register

I've created a module for Drupal8 that checks against values in the user register and set an error if the values do no match with something you have entered in a custom form. My module has got a form ...