Questions tagged [form-validation]

Denotes question related to form validation. form validation contain frontend forms, adminhtml forms, UI components based forms

Filter by
Sorted by
Tagged with
3
votes
2answers
105 views

How to validate Magento 2 form field input value with database table field to find out if already exists?

I have added following affiliate email field (custom attribute) to the customer registration form. Now I want to validate that if value already exists in the database table. <div class="control"&...
1
vote
1answer
88 views

Magento 1.9 - Add custom zipcode validation on Home page

Validate a zip code field on a home page popup in Magento 1.9 style might be using jquery button click.
0
votes
0answers
182 views

Magento 2 - How to remove phone number validation in adminhtml

Magento 2 I want to remove phone number validation in customer addresses in admin panel --- Screenshot for your reference ----
7
votes
4answers
1k views

Magento2 How to add custom validation for password?

I want to change default validation for all password field. I want to change for all password field and validation is minimum 8 characters and at least one number include. Can anyone help me with ...
0
votes
1answer
78 views

Customer Register Page Validate min 1 Char to 10 Charcters - Magento 2

I am trying to Change Validation in customer Registration page for first name and last name. I know i can do this by setting maxlimit by overriding core template in theme folder. vendor/magento/...
2
votes
1answer
397 views

How to validate form fields such as city, zipcode in address form

I have done form validation as follows <form class="form-address-edit" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>" method="post" id="form-validate" enctype="...
2
votes
1answer
645 views

Form Key Validation Error

So I have fixed my form key validation issues but my admin is still showing an error message. Important: Formkey validation on checkout disabled. This may expose security risks. We strongly ...
3
votes
1answer
497 views

Register password strength meter not working in Magento 2.2.5 CE

I have a fresh installation of Magento 2.2.5 CE & tried to create new user on frontend when we type password like Password1 strangely strength meter not showing like weak, strong, very strong its ...
0
votes
2answers
405 views

Validtaion is not triggers in custom form in magento 2

I have created custom form inside the popup. without filling the form, i am trying to submit,immediately it submits the data instead of validating the fields. Plaese provide me a solution. form.phtml ...
0
votes
1answer
269 views

error “File Input” is required value Magento 2

I have a customer attribute that is "File Input", type is file and require is true but I do not let it show in customer register. When I try to create an account it displays the error like this: How ...
1
vote
0answers
297 views

Custom form field not showing validation message

I have created one custom form and implemented magento validation. Magento validation works for all fields but message of one field is not displaying. I have added datepicker in this field. Below is ...
0
votes
1answer
299 views

Magento 1.9 change error placement of validation

I have the below code on my product view page: <input type="text" class="price required-entry input-text" name="price"> <span class="input-text-price-unit">INR</span> Since it has ...
0
votes
1answer
120 views

What is Validation class for Floating Point numbers

magento 2 have Validation clases for admin forms Like this for integer. What is for floatting numbers like 12.00 or 23.33 <item name="validate-integer" xsi:type="boolean">true</item&...
0
votes
2answers
894 views

Ajax request from key validation in magento 2

I need to done an ajax request in Magento 2. But for security purpose, I need to check XSS attacks all possible case. In Magento 1 form key validation and in Magento 2 form key validation is quite ...
0
votes
1answer
515 views

Magento 2: Data validation message input field

I created an input box in Magento 2 and let the validator check the input value. That works perfect in the example below: <input id="input-gleich-breite-0" class="maximum-length-4 validate-...
0
votes
1answer
271 views

Magento 1.9 contact form validate required not working

For some reason our select dropdown is not required and does not validate the entry. It already contains the class 'required-entry' for the select. What am I missing here? <form action="<?php ...
1
vote
1answer
693 views

magento 2 - add max length for input fields in Review & Payments/billing form

I am trying to limit number of allowed characters on Firstname input field in my payment methods on Review & Payments area. I am using the magento default check/money order payment method. ...
2
votes
0answers
333 views

How to remove validation from the “City” and “Street Address” Field on Customer Registration Page?

I've added "Address Information" on customer registration page & want to remove the mandatory field from the "City" and "Street Address" Field for that I've overrided register.phtml file on my ...
2
votes
1answer
1k views

Magento 2 add maxlength in form ui component

I know magento give max_text_length validation for validating length & print error message regarding it, but I want to add attribute in my input field as maxlength="5" so i can stop user to adding ...
1
vote
0answers
24 views

Translating Error Messages on Address Form

When only entering a few Required Fields when logged in and Adding a new address. And then submitting that form, the error messages come back in English and not the translated format that is required....
2
votes
2answers
490 views

Server side validation in magento forms

I have created a form in cms page and direct it submit action to a controller how to do server side validation and save data to my database app/code/Dyode/Pricebeat/view/frontend/templates/pricebeat....
2
votes
1answer
794 views

Magento2: Add date-from validation for dob (date of birth) field in customer creation

I want to limit the dob field in account creation form to be not less than 01/01/1900. I thought 2 way: - limit the calendar widget (but maybe someone could input the date directly) - add a ...
2
votes
1answer
1k views

Magento2 : Credit card validations on a custom form not working

I am trying to add Credit card validations on Custom payment form <form id="testForm" data-mage-init='{"validation":{}}'> First name:<br> <input type="text" ...
0
votes
2answers
1k views

Select validation in magento2

I am using magento2.1 If I am using class="validate-one-required-by-name and validate-select" it's not working. <div class="control" style="margin:10px"> <select id="myselect" name="...
0
votes
1answer
258 views

Checkbox validation

I want Checkbox required field I agree to the Terms and Conditions. I am using this code but it's not working.
0
votes
1answer
374 views

Magento 1 Custom form validation is not working

I try to validate my form but it doesn't work and i don't know why. Please help me to find problem. Thanks <form action="<?php echo $this->getUrl('vendor/addproduct/new') ?>" method="post"...
1
vote
1answer
776 views

Magento 2 - Please enter less or equal than 255 symbols valiadtion error in checkout page

Magento 2 - Please enter less or equal than 255 symbols error message in add new shipping address popup form Currently i am getting an error validation message when i open the add new address form to ...
0
votes
0answers
62 views

Form validation in magento2

Here is my template file content. <form action="#" method="post" id="newuser_form"> <input name="form_key" type="hidden" value="<?php echo $FormKey->getFormKey();?>"> <div ...
1
vote
1answer
1k views

How to do form validation in Magento 2?

I have added custom form in customer account navigation. Looking for code to form validation. is there anything like form-validate like in magento1? I have used in magento1 like below. var ...
6
votes
1answer
971 views

magento 2 UI Component form Character Limit Validation

How to create custom Validation for UI Component Form? I want to create Validation for maximum character, not for max-word which is already available in Magento 2. if any body knows please share the ...
2
votes
2answers
6k views

Magento 1.9 Create Custom Form and add Validation

I would like to have a custom form with name, address and email fields. However, I am unsure how to achieve this using the proper magento way. At the moment I have the following raw form in my cms ...
0
votes
1answer
1k views

Digits Range Validation in the UI-form

How to add digits range validation rule to the input field inside the UI-form?
1
vote
2answers
473 views

How to do the server side validation for login form?

I have done client-side validation but how to do the server side validation for the login form.
3
votes
1answer
337 views

Custom Checkout Validation - Two fields must have the same value : M2

I have read this URL for equalTo validation. I have add custom field using LayoutProcessor.php file and set validation like this : 'validation' => ['validate-no-empty' => false,'validate-...
1
vote
1answer
434 views

How to hide specific days from admin form calendar field in magento 2

I want to disable week days (Saturday & Sunday) in admin form calendar field. check below screen-shoot. Below is my field code. $fieldsetDirector->addField( 'attendance', 'date', ...
0
votes
2answers
776 views

magento2 Form Validation and FileUpload Plugin not working

i am trying to upload file and it work fine, but form validation is not working when i add file upload JQuery code NOTE: below All code in same file(test.phtml) <form name="questionnaire_form"...
4
votes
1answer
7k views

Magento 2.2 Input field validation on Checkout page

In /vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php, I can find blow code (getBillingAddressComponent), which is used to validate the billing address input fields, and I can change ...
0
votes
2answers
66 views

How Can I Check If Mail id Available in DB or not?

I am getting so many spam from inquiry submission, My contact form : <?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that ...
0
votes
1answer
251 views

Add required Checkbox for Newsletter subscription form

Is there a way to add a required checkbox to the newsletter subscription form? The idea is to make the user agree to the privacy policy before subscribing for the Newsletter.
0
votes
0answers
156 views

Undefined Index exception in Custom module form submit data

getting an exception while submitting data in form but data is saving in the database? how to remove that undefined exception This is the controller code <?php namespace Quadone\Caregiver\...
1
vote
1answer
1k views

Magento 2, why data-mage-init validation not working when I use knockout component

I have a phtml file with a form that used data-mage-init <form data-mage-init='{"validation": {}}' class="form" id="custom-form" method="post" autocomplete="off"> </form> and then I ...
2
votes
1answer
2k views

Magento 2 how to validate customer registration form on keyup event

I am working on a project where I need to validate customer registration form as customer types. I want to use the event keyup for inputs. I want to change the default messages also. Right now I am ...
1
vote
2answers
1k views

Magento2 : Add Password strength meter in login form

How to add Password strength meter in customer login form? <item name="authentication" xsi:type="array"> <item name="sortOrder" xsi:type="string">1</item> <item name="...
0
votes
2answers
328 views

How to keep company field optional in magento 2

I want to override Shipping address field At present, the shipping address, Company Name is a required field https://www.screencast.com/t/8PgjgHxoM Occurs in the checkout page.
4
votes
0answers
464 views

Before place order validation in magento2

In magento2 before place order check new customer form (billing address form) open and filed is not fill then not place order and show message please fill the form then place order, now in magento2 ...
0
votes
0answers
226 views

Shipping Address validation

I need to validate text fields in magento shipping address popup in checkout page.I can edit validation for other forms locally.I tried many thing still not able to find the solutions.please send the ...
1
vote
0answers
51 views

Magento 1.8.x: Validate 'Add to Cart' Button on Category View

I'm trying to add form validation on the category view and to show error message on the category page. Currently, if there's an error it will redirect you to the product view page and display the ...
0
votes
1answer
88 views

How to change the type of validation used in fields on Magento 2 forms and where to find the list? [Q&A]

Say I wanted to validate my contact form to only accept UK phone numbers and a valid amount of currency, how would I do this in Magento 2? I want to change my contact form so it allows my users to put ...
1
vote
0answers
276 views

Magento 2 : How To Customize Validation Error Message

Is there a way to add a custom error message to a custom validator? I use already the default rule required-entry, can I define my own rules? and where exactly? I found something with overwriting ...
0
votes
1answer
530 views

How to trigger default magento validation in custom module in magento 2

I have created custom module for magento review module, Now All the functionalities works fine. But default magento validation is failed for Review form. Now, How do i trigger the dafault validation ...