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

learn more… | top users | synonyms

0
votes
1answer
16 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
0answers
17 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
20 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
35 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
25 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
24 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
0answers
27 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
0answers
15 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
19 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
149 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
15 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
46 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
15 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
27 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
21 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
32 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
53 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
26 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
16 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
73 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
33 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
38 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
40 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
36 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
74 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 ...
0
votes
1answer
57 views

Checking if a machine_name exists or not

My EntityForm has a field where '#machine_name' => array( 'exists' => array($this, 'load'), To check the validation of this, I wanted to know about writing the function load() in my ...
1
vote
2answers
181 views

Drupal 7 : Programmatically validate form by form ID

Intro - i am trying to implement Sales Force form within Drupal FAPI but now it requires to add captcha so i need to send first request to internal page so i could validate captcha and only after this ...
0
votes
0answers
29 views

Field Validation and Internationalization / Translation

I am using the Field Validation Module as I do need to validate things like phone numbers, emails etc. I like the module, but it seems the CUSTOM ERROR MESSAGE is not translatable. i.e. it doesn't ...
0
votes
2answers
43 views

Multiple validation

I have a problem regarding validation. I have created a custom validation for email, but i want two additional validations for user name and last name. But only email field is getting validated. My ...
1
vote
1answer
125 views

form_set_error message delayed one page refresh

I'm making a custom validation in a form I'm making but my error message is always delayed by one page refresh. $form['submit']['#validate'][] = 'asap_sollicitation_form_validate'; function ...
0
votes
0answers
32 views

Drupal 6 content type sometimes saving blank required fields

First time question - so I hope I do this right. I have a problem where periodically and seemingly randomly new content type nodes with many required fields are being saved to the database with all ...
0
votes
1answer
1k views

How do I validate form elements via onblur events?

I am trying to validate a form element when it loses focus. But I am having issues calling the validation script. I have tried both: drupal_add_js('( function ($) { ...
0
votes
0answers
55 views

Using hook_webform_submission_presave in validation handler

I am trying to modify the value of a hidden email field based on user input before the value is saved to the database and the email is sent. I thin using hook_webform_submission_presave is the way to ...
0
votes
0answers
22 views

Form alter validation

I have a problem with form alter validation when i clear the cache it works will but after that it does not see my code, why is that !? here is my code: function ...
1
vote
0answers
30 views

Why Conditional Fields Validating the Hidden Fields?

I have preset sizes like small, medium and large and an option to provide custom size. If some one selects custom option from a select list the measurements fields appears through conditional fields ...
0
votes
0answers
48 views

set form error inside computed field

I am doing complex calculation using computed field and trying to set form_set_error and stop form submission, also filled values should be retained. form_set_error($field_val, t('Validation ...
1
vote
2answers
72 views

How to test a database connection?

I'm writing a module that will have to make a connection to a seperate database. In order for the user to configure the database, I'm allowing the user to fill out the database connection info in the ...
2
votes
0answers
31 views

Dealing with #disabled and #access in hook_field_validate

is there any way to disable hook_field_validate when the corresponding field widget is disabled (via #disabled = true or #access = false) in corresponding form? Or, alternatively, is there at least ...
1
vote
1answer
33 views

Unable to retrieve user id of edited user from $entity in hook_field_validate

I have this little problem with a custom field that is bundled with user. In its validation function I need to have access to the user id of the user whose field is being edited. What that means is, ...
0
votes
1answer
66 views

Showing a message while downloading a file from hook_form_submit

I have a form which creates a csv file and starts a download if it is successful. I also attempt to show a success message at this point but it never shows up because I use drupal_goto to download the ...
1
vote
1answer
128 views

How to set value in form validate for later validation functions [closed]

Problem I'm adding the user register form onto the node create form with hook_form_alter. The problem is the first step of account validation always fails because Drupal doesn't save Username to ...
0
votes
2answers
180 views

Custom field validation with date time field

I have a content type called 'Event' in which I have used one date time field for storing the event starting and end time. Now I should have a field validation for a that date time field. For example, ...
0
votes
1answer
343 views

Unable to add custom validation rules using client side validation module in Drupal 7

First I want to clarify that I am new to Drupal. So please excuse me If my question is naive. I have installed the Client Side module in Drupal and it is working fine for all the required fields. I ...
0
votes
1answer
33 views

check other commerce pane validation error

I am work on commerce pane, in hook_pane_checkout_form_submit($form, &$form_state, $checkout_pane, $order) I call a function to do something in pane sumbit, something like function ...
0
votes
0answers
49 views

What would cause a form validator with the right naming convention not to execute?

I am supporting a site that uses version 7.x-2.0-alpha of the File Entity module, and a user reported that updating files was not working. Using a debugger and comparing to another site, I tracked ...
0
votes
1answer
40 views

Highlight valid form element

I'm using clientside validation module. It highlights only errors. How to display for example a green mark beside valid form elements?
1
vote
2answers
618 views

How can i remove required field validation on click submit button?

I have some radio buttons such as draft, need review, etc. I want to remove (omit) the required fields when draft is selected, and click on the submission button. I tried with below code but it is not ...
0
votes
0answers
121 views

Custom Validation doesn't work on Webform Multistep with pagebreak

The code below works on a non-multi-step form but doesn't work on a multi-step webform using the page_break. function THEME_form_alter(&$form, &$form_state, $form_id) { ...
0
votes
0answers
257 views

D7 form_set_value : Fatal error: Cannot use object of type stdClass as array in

I want to use the function form_set_value to replace a taxonomy vocabulary by an other in my form. What's happend if the value is not a string, but an object. In this case I have an error. The form ...
0
votes
2answers
205 views

Validate a group of fields so that form can only be submitted if 0 or 2+ fields have been completed

In Drupal 7 I need to validate several cck fields so that the node can only be saved if 0 or two or more fields have been completed. So if only one of the fields is completed validation would fail ...