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

learn more… | top users | synonyms

0
votes
0answers
23 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
14 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.
0
votes
3answers
47 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
56 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
34 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
53 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
1answer
24 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
57 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 ...
1
vote
0answers
40 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
1answer
19 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
39 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
29 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
63 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
224 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
28 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
108 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
130 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
67 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
105 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
42 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
58 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
36 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
152 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
213 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
170 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
66 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
121 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. ...
0
votes
1answer
243 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, ...
-1
votes
2answers
159 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
200 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
111 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
58 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
334 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
121 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
177 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 ...
0
votes
1answer
148 views

Red border error indication is not generated

I am making a shopping store site with D7 and Drupal Commerce. In the checkout pane page, there are several form fields for information of customers such as name, address, phone, and so on, have set ...
0
votes
1answer
165 views

validation of text box and checkbox

I am trying to validate the form. I have one hidden textbox and one check box group. field_institute_event - represents checkbox group. posted_student_list - represents hidden text box. If both ...
0
votes
1answer
77 views

How to validate input data that are previously saved?

I am creating a module that can store user input in db and populate in a listing page with validation. I am collecting all values before submit i.e. any change in any field I store the form state in ...
0
votes
1answer
67 views

drupal_validate_form not validating more than one time on listing page

i am using drupal_validate_form on a node listing page . it is validating it correctly only for 1st item after that it is not checking validation. here is my code foreach($result as $r){ ...
0
votes
1answer
30 views

Not validating required validation

drupal_validate_form is not validating required validation when i was creating a node programatically . Can any one say, it is design like that or am i doing something wrong . $node_form = ...
3
votes
2answers
568 views

Sorry, unrecognized username or password error after successful login

In user_login block form alter I'm attaching a validator : ws_res_auth_authenticate ( the last one in the dsm output below) and logging in a user using this code: user_login_submit(array(), ...
0
votes
0answers
40 views

file_validate_size doesn't seem to work

I'm currently learning how to make a custom module that creates a block with a textfield and upload field. So far so good, only thing is: Drupal doesn't seem to respect my file_validate_size value. ...
1
vote
1answer
178 views

Password may contain illegal characters

Is it possible to change an option or overwrite the password validation so that a user can add characters like é to their password?
0
votes
0answers
32 views

required validation fails in drupal_validate_form when creating node programatically

drupal_validate_form not validating the required validation . when i was trying to create a node programatically all the validation works fine except required validation is this process like that or ...
0
votes
1answer
116 views

How to save a form inputs in database and retrieve it from database with out form submision

hi can i store form inputs in database and retrieve it from database with validation I search many sites but neither any documentation or example or any thing i found for drupal7 . I didn't ...
0
votes
0answers
115 views

Custom validation with conditional fields

I have a content_type campusactiviteit which has a lot of conditional fields. When the user hits "catering" three fields appear: "kostenplaats", "bestelbonnummer" and "soort_catering". When the user ...
0
votes
1answer
83 views

How to show validate error of a node listing page

i am trying to save form state in database and want to view in a listing page with its error validation. i.e, i want to validate a previously saved form state from my database. this is a node type ...