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

learn more… | top users | synonyms

0
votes
0answers
21 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
27 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
19 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
26 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
25 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
38 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
100 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
77 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
21 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
45 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
23 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?
0
votes
2answers
97 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
41 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
99 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
59 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 ...
0
votes
1answer
38 views

User registration silently fails - how to debug?

On our Drupal 7 site, user registration silently fails. Drupal doesn't even reach the form's validation functions. What we checked: disabling javascript didn't help. Removing installed modules ...
0
votes
2answers
46 views

User registration form: Give username “username n+1” value, if and when n is already used

I'm using the first & last name in the user registration form to generate the username for the new user: $firstname = $form_state['values']['field_firstname'][LANGUAGE_NONE][0]['value']; ...
0
votes
0answers
28 views

Webform conditionals limitation problem

I've been asked by the recruitment team to implement a recruitment form for their team. They have sent me a series of instructions. These are (modified for anonimity). I use the latest release of the ...
2
votes
3answers
241 views

Custom validate exposed filter on a view

I have a view with a single exposed taxonomy field that requires the user to click apply before any results are shown. The options in the list appear like this Please Select (All label overridden ...
0
votes
1answer
45 views

comment form custom validation

I am using a custom validation in my Drupal 7 comment form.I want to match the comment_body against a word "example" so if someone just type "example"in the comment body then it will show a error ...
0
votes
0answers
69 views

How to validate and collect errors from CSV import without submission failure

I have been tasked with creating a tool which accepts a CSV and presents it in a spreadsheet display with additional dialogues to explain and link to errors on the display. Have investigated / ...
1
vote
2answers
75 views

Custom Validation while adding a term under taxonomy

I want to use custom validation while adding a term. I used form alter and #validate function it's not working.Default validation function under taxonomy module is working but my custom validate ...
0
votes
1answer
82 views

7: Form: Skip required body field validation

It's possible to skip required body field validation, if it's empty? I can add custom validation on the first place, like: $form_validate = $form['#validate'][0]; $form['#validate'][0] = ...
3
votes
1answer
84 views

Alter default message presented to user on failed login attempt

I need to alter the default D7 message that gets presented to the user on a failed login attempt. I need to give them one message if their username isn't found, and another if their password is wrong. ...
0
votes
1answer
218 views

dynamic fields are not retaining values on form validate (refresh)

I have dependent select list (dynamic dropdown) in my form. When I change a value of the first select list, the second select list is automatically pouplated using ajax callback. Both select fields ...
1
vote
1answer
236 views

How can I skip field validation if the field is hidden?

I get a node form with node_form and then I render it with some modifications. One of the modifications is that I duplicate the fields so I have the same fields twice. One field is disabled and the ...
0
votes
0answers
27 views

Getting rid of the form validation error bubble in Panopoly

In Panopoly, errors that display with form_set_error() do not display in a block at the top of the page the way they normally do in Drupal. Instead they display in a floating popup that looks like a ...
0
votes
0answers
8 views

difference between real click and jQuery click [duplicate]

I create a new subject which is the next of this one. I have a form on drupal. There is a function to create it : commerce_checkout_account_pane_checkout_form There is a function to validate it : ...
0
votes
1answer
96 views

How to prevent button to use validation function?

I have a form with a submit type element and a button type element. For the form I have a validation and a submit handler functions. The validation should occur only when I click on the submit type ...
0
votes
0answers
345 views

form_validate work with ff, not with chrome using jQuery trigger click

I have create a form with form_validate and form_submit functions. Using Firefox, everything is OK so the problem is not about an error in functions names. Using Chrome, when I click on submit the ...
0
votes
0answers
174 views

How to validate a AJAX submit form inside lightbox

I have a content type called "Group". I submitted the content type using AJAX. Everything works fine but I am not able to validate the form. Please note that I opened the form in Light Box and I want ...
0
votes
1answer
179 views

Form Validation. Ensure Placeholder is not submitted value

I have a Drupal registration form with a placeholder set on a first name field. I am trying to get the form to check so that if the placeholder value is the same as the submitted value it will give an ...
1
vote
0answers
88 views

user--register.tpl - show validation error messages

I have overwritten theme of registration form using the file user--register.tpl But when have some validation in the form, I cannot see error messages. How can I display error messages generated with ...
1
vote
1answer
86 views

Using clientside_validation project, default validation plugin message not being overridden for states dependent field

I am currently using clientside_validation with clientside_validation_states to validate conditionally required fields. The issue I am experiencing is when the conditionally required element is ...
0
votes
0answers
71 views

How to change server side error message default sequence for content type form in drupal 7?

I used content type for “Add user form” with following sequence. First Name Last Name Email address Confirm Email Address when I submit blank form it shows me server side validation messages ...
2
votes
1answer
205 views

Validating node creation / edit form

I'm using form_alter to play with the node form for a specific content type. This content type has many different fields and I'm also using Field Collection module to organize all these fields & ...
0
votes
1answer
156 views

How to validate temporary files with form API

Problem I have a custom form with three file fields. The files are selected, then on submit they're attached to an email and sent off with a call to hook_mail. I'm pretty sure the files aren't ...
0
votes
0answers
200 views

Add Custom validation with Clientside validation

Can anyone show me an example for adding custom clientside validation in drupal? I need to add my custom validation work with client side validation. I want to make it work my custom validation with ...
0
votes
1answer
33 views

how to check whether an error occurs due to a specific field in drupal?

Inside a validate function how can I disallow errors for a specific field and allow errors for a specific field. Like if I get errors for a field_abc I would like to clear that specific error and ...
0
votes
2answers
83 views

“Illegal Choice has been detected”

I want to prevent validation check on the field_abc ? How can I prevent validation for a field_abc function test_mail_menu() { $items['test-mail-1'] = array( 'page callback' ...
2
votes
1answer
85 views

Validate form: at least one of the fields is required

Users need to fill link fields wrapped in a field group to their various social profiles like fb, twitter, pinterest. I need them to give any one of the fields as required since I use it to verify ...
2
votes
1answer
464 views

Adding validation to commerce pane form

I want to add validation to the user's details form. I've tried to use the #validate to add validation function, but nothing happens. This is the Code: function ...
0
votes
2answers
466 views

Adding validation to existing forms using #element_validate

Problem I'm using #element_validate to validate an input on a custom form which creates a node. I'm using element_validate_integer_positive as the function to validate. It works perfectly. It ...
0
votes
1answer
104 views

Webform validate 18 years old (GNU Date Input Format)

I'm looking for a valid webform date pattern, to validate a user's birthday (component date). I want to make sure the person is 18 years of age or older. However, Drupal requires the GNU Date Input ...
1
vote
3answers
228 views

Validate if Date1 > Date2

If I have 2 date fields in a content type: Event Start Date and Action Start Date. Is there a way to validate that Action Start Date is later/greater than Event Start Date while creating the ...
1
vote
2answers
168 views

Removing all validation on submit

I have a multistep form with two submit handlers (save/submit), when "Save" is clicked I want to remove any validation applied to the node and have it's contents saved. In my custom validation hook I ...
0
votes
1answer
48 views

Apply a dynamic string to a field before validation

I am attempting to set the "title" value of a content type before it becomes "required" . So what happens is the title field becomes hidden based on user name, after filling in the "first name" and ...
0
votes
1answer
119 views

Validation at node_presave in drupal 6

I received a somewhat complicated Drupal 6 application to maintain and unfortunately I am quite a newbie with Drupal. The task is to verify certain system variable is set before saving the node. Is ...
1
vote
3answers
268 views

RSS Feed does not validate using Views RSS module

Drupal version: 7.14 Views RSS version: 7.x-2.0-rc3 I am trying to validate an RSS feed in feedburner for a drupal blog. When I try to validate de xml file at feedvalidator.org I get this error ...
0
votes
2answers
378 views

No option to validate for email in drupal webforms validation

I've installed both the Clientside Validation module, and Webform Validation, but there is no option to validate for "valid email" in the "Form Validation" tab of the webforms edit panel. Clientside ...