Questions tagged [drupal-form-validation]

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

Form validation is the operation through which form fields are verified to contain the correct input. User-submitted form data are validated either through regular expressions or PHP code.

See also

13 questions
1
vote
3 answers

Drupal wizard form: Validation and previous button

In my drupal6 site I have wizard form. I implemented it with FormAPI using form storage and the rebuild property. My form validation is being done with the #required property and with functions in the #element_validate property. It's working fine…
Luiz Guilherme
  • 1,601
  • 21
  • 37
1
vote
0 answers

Trigger on form field when there is change in other form field angular5 form validation

I have an issue of triggering an error in a input form, if other form field is changed. myFormGroup = new FormGroup({ 'name': new FormControl('', [ Validators.required ]), 'material': new FormControl('', […
1
vote
1 answer

Caching product display with Display Cache and still be able to add products

I'm building an eCommerce website using D7, mainly with Commerce and DS. To get a better perfomance I installed Display Cache which is a module that caches the rendered HTML of an entity for anonymous and authenticated users. In my particular case…
1
vote
2 answers

Drupal validation solution when using file upload with other required form field

I am having problem while trying to upload a picture in a form that also has other required field. So if I dont enter anything on the required field and upload the picture, I lose the picture that's uploaded (during the form validation the picture…
Neela
  • 311
  • 1
  • 4
  • 16
1
vote
0 answers

Switch off JavaScript validation

I am using the Webform and the Inline Form Errors module, and I want inline validation. However, out the box, the Webform module seems to have some JavaScript validation and I would like to turn it off. How can I achieve this?
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
0 answers

How to validate max post size on custom form

I have a custom module with a multiple managed file upload. $form['attachments'] = [ '#type' => 'managed_file', '#multiple' => true, '#upload_validators' => [ 'file_validate_extensions' =>…
0
votes
1 answer

Stumped on Drupal 7 - adding user_profile_form #validation callback via hook_form_alter

I've searched, read, and re-read. I've even stripped a test module down to the most basic elements. I think this code should work, but the validation callback is never called. I add the callback to the form, but it is gone at the next…
0
votes
1 answer

How to create an entity reference field which will allow unlimited values in a configuration form?

public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $config = $this->config('category_dynamic_block.settings'); $form['section_title'] = array( …
0
votes
1 answer

Check if form failed validation

I added a validation hook to a node creation form. For my project, i need this validation only ONE time: basically i just check if a value already exists in the DB and i notify it to the user. If the user still submits the form, i must add it…
gbalduzzi
  • 9,356
  • 28
  • 58
0
votes
0 answers

How to disable HTML 5 client side form validation for Java

I'm trying to use the following code to disable form validation using JavaScript which isn't working: ((JavascriptExecutor) webDriver).executeScript("document.getElementById('node-event-form').noValidate = true;"); Whereas the command…
avi
  • 1,847
  • 3
  • 16
  • 17
0
votes
1 answer

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

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 validation? it is a block view of webform in…
0
votes
0 answers

Run checks on drupal_goto function

I have a strange issue with a drupal site and a custom form. I have a custom module that puts a form as a block...simple input field that posts a search query to a store locator. The form keeps getting overridden and the action/url changes randomly…
0
votes
1 answer

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){ $node_form = (object) array( 'uid' =>…
Lucifer
  • 516
  • 1
  • 6
  • 25