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

learn more… | top users | synonyms

1
vote
1answer
12 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
17 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
14 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
22 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
153 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
13 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
60 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
35 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
34 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
44 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
65 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
1answer
17 views

Textfields are not populated with user inputs after validation fails

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
17 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
43 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
29 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
79 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
98 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
99 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
38 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
83 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
123 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
98 views

Validation and Setting value for Multi-value fields

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
165 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
86 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
34 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
221 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
87 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
121 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
102 views

Red border error indication is not generated

I am making a shopping store site with D7 and commerce. In the check out pane page, there are several form fields for information of customers such as name, address, phone, and so on, have set up ...
0
votes
1answer
117 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
68 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
53 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
27 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
412 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
32 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
120 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
29 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
93 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
72 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
59 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 ...
0
votes
0answers
341 views

Error messages not appearing inside of modal

I have a registration form showing up in a Bootstrap modal. I attached a validation function like so, which appears to be working, but when the page reloads, the error messages which I hope would ...
0
votes
1answer
58 views

Setting #element_validate in a form (not form alter) removes original #element validation

I have an element with set #element_validate (in hook_element_info) and I use this element in a custom form. The problem is that when I try to add an additional #element_validate to the element in the ...
0
votes
0answers
27 views

Disable validation for certain part of a (highly nested) form

I have a rather complicated form for events & actions editing. It always includes one 'subform' for an event and N 'subforms' for actions. The #parents hierarchy looks like this (it's more ...
0
votes
2answers
247 views

How to validate node title field Drupal 7

I want to add validation to the node title field. When the user enters the character X and submits the form they should get a message saying "you are not allowed to enter special character X".
1
vote
1answer
82 views

Alter taxonomy autocomplete value

I need to alter the element value of a taxonomy autocomplete field before it is processed and can't seem to find a way of doing so. taxonomy autocomplete fields have an element validator attached, ...
0
votes
0answers
150 views

Webform validation error messages show for some rules, not for others

I'm using Webform with Clientside Validation to create a form. I have created a field with the name 'Address', which is supposed to contain a street name and number. To validate this, I have created a ...
0
votes
1answer
69 views

bypass a character limitation rule (webform)

Maybe someone could help me ... Ive got a webform with an input (postal code). I want its maxlength to be 5. When users fill it, once the 5 digits entered, an autocomplete callback retrieves ...
0
votes
3answers
143 views

conditional validation in webform

I have webform 7.x-3.18+3-dev and webform presav e 7.x.1.1 installed how can I make one field be obligatory depending on another field. Eg if someone selects phone as best form of contact they must ...
0
votes
1answer
144 views

Is it possible to change the form submit handler from within a validate handler (need to redirect to another form depending on values entered)

I have an initial webform (based on 3.x of webform module/Drupal 7) that needs to redirect to a second form if yes is specified in a yes/no choice. Otherwise if No, the first form should submit ...