Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [validation]

Denotes questions related to validation like form validation, jQuery validation, prototype validation, server-side validation.

0
votes
0answers
7 views

Inline validation error in login form Magento 2

Right now, I am getting a global error message for wrong email/password`. I want it to be an inline error message instead of a global message. Like this. Right LoginPost.php sets error message , i ...
0
votes
0answers
32 views

Magento 2 checkout postcode validation only numbers

Magento 2 in checkout page postcode, I want to restrict alphabets allowed only numbers, how can I set by using a validation XML file? I tried below link for postcode validation number <item ...
2
votes
0answers
23 views

Authorize.net not accepting any testing Credit card on Magento 2.2.5 in sandbox mode

I have managed to successfully configure authorize.net with latest SHA on Magento 2.2.5 and its appearing as payment method but when i enter credit card no. it gives error saying "Please enter a valid ...
1
vote
0answers
20 views

How to validate custom text field in magento checkout form

I have added custom checkout field in magento 2, and made it required, how can I add more validations and custom messages. Below is my code snippet to make it required: dataScope' => '...
0
votes
0answers
18 views

How to do password validation part without form (Magento 2)

I have a form which has password change functionality, the issue for a change I wrote my own controller and I change the button to type = 'button' from submit. Now how can I validate the password? I ...
0
votes
0answers
33 views

Magento 2.2.3 How to change validation message Or add new custom rule in system config field

I want to change default validation message in system config field. Below is my system.xml code. <field id="maxlabel" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="13" translate="...
1
vote
0answers
52 views

Magento 2 : How add validation validator to custom input field in checkout page?

We have to add custom form in check-money order payment method.We have to add custom validations before order placement but its not working. please check below code 1)Create the validator:- ...
2
votes
2answers
49 views

Magento 2.2.3 - Add custom required validation for company

I want to add validation only for billing address on the checkout page. By default in the backend, the company name is optional. But if when I go to the checkout page and click on the Place Order ...
1
vote
0answers
24 views

Magento2 : Grouped Product's child product add to cart issue

I have an issue in grouped product's child product add to cart validation issue. In one grouped product have three (3) child products while click on add to cart button of last child product without ...
1
vote
1answer
47 views

Magento 2 : How to put custom text in form validation?

I have this message when i validate post code How to change it? I tried overriding postcode-validator.js define([ 'jquery', 'mageUtils', 'Magento_Ui/js/model/messageList'], function ($, utils, ...
0
votes
0answers
27 views

How to show validation fail message?

I added a form to my site and a field which needs validation, this is the field: <input class="newsletterInput validate-length maximum-length-20 minimum-length-3" name="first_name" ...
0
votes
0answers
43 views

Quantity not getting validated (the way it should) for numbers between 1 - 9

I have problem with quantity increments, unable to increase the quantity for a product in the cart by increasing the quantity number in the input field, the input field for quantity does not seem to ...
0
votes
0answers
26 views

Magento2 : How to validate admin grid checkbox column?

I want to check before submitting admin form that any product is not selected in admin grid then it must generate error message in admin grid.
0
votes
1answer
34 views

Magento 2 Default form validation

How can i add pattern="[0-9]*" validation in my login form ?
0
votes
1answer
24 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/...
1
vote
1answer
30 views

How to add custom validation to checkout phone field

I have checkout_index_index.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/...
-2
votes
1answer
122 views

How to apply validation to customer address edit details in customer_index_index.xml

I want to validate the customers forms using the .xml UI validation.
1
vote
0answers
16 views

Login form validation is working but other forms validation is not working

I have tried all types of method but only login form validation is applying. But other forms not working. Even writing js in the phtml is not applying for the other forms. <form class="form form-...
1
vote
0answers
24 views

form validation is applying to login form but not for other forms

For me login form is working (used data-mage-init='{"validation":{}}' in form and minlength:6 ). But the same is not applying for the other forms <form class="form-address-edit" action="<?= $...
1
vote
0answers
18 views

Form Validation is not working for names and phone number min length

Hi I tried all standard method of validation like minlength:6, add data-mage-init='{"validation":{}}'in form and all standard tags. But validation is not working.Please anyone suggest me
2
votes
2answers
1k views

“Your session has expired” - Magento 2.2.7 fresh install

I've started out with Magento 2. Everything's working fine, except for Magento's formKeyValidator which isn't able to validate the incoming request. It's happening on the frontend. While adding a ...
0
votes
1answer
58 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 ...
0
votes
0answers
33 views

What is the purpose of validation.xml file in Magento 2?

What is the purpose of validation.xml file in Magento 2? When and where do we use them ? I see there are couple of validation.xml files in Magento 2 directory. For example: vendor/magento/module-...
0
votes
0answers
15 views

Magento 1.9 validation.js - how to ignore disabled selectmenu

I have a problem regarding configurable products. There are multiple selectmenues. I have to disable some on certain situations, e.g. if a specific value was set in another select menu. Problem: If I ...
0
votes
2answers
178 views

Magento 2:Checkout phone number field should accept numbers plus special character like (-)?

In magento 2.1.X version checkout phone number should accept special character like (-) and should limit to 15 characters but currently it is accepting 10 characters only? I did searched the core but ...
0
votes
1answer
62 views

Magento2 Create account form custom field server side validation

I Added a custom sponsor name field on magento2 account creation form and done client side validation also. How can I do server side validation??? Need to check sponsor is available in database or not....
0
votes
1answer
223 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
0answers
34 views

Custom validation customer telephone in registration, edit and checkout

I have to add a particular Regex to validate the customer phone number both in the frontend (via the validated js) and the backend side. I do not understand what is the most correct way to add a ...
0
votes
3answers
375 views

How to validate phone number for billing address in magento2.1.7?

How to validate phone number for billing address (should accept only number's and it should not exceed more then 10 digits) in magento2.1.7?
0
votes
1answer
64 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 ...
0
votes
1answer
180 views

Error message display using js in backend

I want to display an error message on the form/listing in magento 2 back-end. I know how to show those message using a controller. But how can i achieve same with JavaScript.
1
vote
0answers
55 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 ...
0
votes
1answer
67 views

Add to cart glide image animation | Fly to cart image animation. PHP/jQuery/JavaScript validation on successfully adding product to cart

I am trying to make a simple glide animation when adding product to the cart to indicate and "highlight" that the product was added. I managed to create a simple (not the best) glide animation for ...
0
votes
1answer
226 views

Magento 2 How to add custom validation rules and apply them?

I'm trying to modify some validation rules for the State input in shipping address. I want to add an error message if user selects 'Texas'. I created a mixin for Magento_Ui/js/lib/validation/rules in ...
1
vote
0answers
20 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....
6
votes
2answers
939 views

Magento 2.2.5: How to validate shipping address

I'm doing Custom Checkout, and here is what i've done til now. The adea is to use validate so when i click on "Next" button, it gonna check if the checkbox in "Terms of Use", if its checked, then it ...
0
votes
1answer
180 views

Magento 2 how to add extra validation to new Billing address form fields in checkout page

i want to put some extra validation to billing address form in checkout page. When a customer in payment page and wants to add new billing address , i want to add few validations to First Name, Last ...
1
vote
0answers
25 views

Magento2 use default password validation in custom module

Can anyone let me know how to use default magento server side validation for password field in my custom module password string?I have dealer registration form and i have password field there and i ...
0
votes
2answers
226 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
45 views

Magento 2 stop Magento updating the SKU on duplicate

When I try to create a product with an SKU the same as one that already exists Magento allows the creation but changes the SKU to be xxx-1. Is there a way to stop this?
1
vote
1answer
359 views

Validate Date range in backend from in magento 2

I have added datepicker in magento2 backend form using following code. protected function _prepareForm() { $fieldset->addField( 'date_started', 'date', [ 'name' ...
0
votes
0answers
43 views

Magento 2 Custom Product Validation

When creating a product I need to make a call to our stock system to make sure that the SKU entered in Magento exists in our stock system. Please, could someone advise the best process for this? I ...
1
vote
1answer
346 views

Magento 2 Custom Validation Rule

I want to validate a custom-category-attribute with regex, when I modify it in backend. Therefor I want to customize validation/rules.js src/vendor/magento/module-ui/view/base/web/js/lib/validation/...
3
votes
1answer
107 views

Magento 2 - Removing Tax with VAT Validation on Prices that Include Tax

We have our catalogue set up so that prices entered in the admin include tax, for example: £75.00 (excl tax: £62.50) During the checkout we also allow people to enter their VAT number which removes ...
0
votes
1answer
330 views

Digits Range Validation in the UI-form

How to add digits range validation rule to the input field inside the UI-form?
3
votes
2answers
282 views

Magento 2 : Specific Range Validation in system configuration field

I'm new in magento. I develop one module in Magento 2.2.2. I want to do like that in system configuration that, user can enter value between 0 to 100 in that field. User can't enter text value and ...
4
votes
1answer
572 views

Magento 2.2.4 Show error message returned by plugin

I'm beginner to Magento2 and I want to validate pincode which exists in custom table or not on Checkout page (www.test.com/checkout/), according to that I want to display error message on same page. ...
2
votes
1answer
155 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-...
0
votes
0answers
62 views

Ajax add to cart not getting a correct price in minicart

I have some problem when I auto add a product on product pages as below: click add to cart a product with ajax. I allow auto add another product after class validator in function process. Example ...
2
votes
2answers
271 views

Magento2 Remove all password validation

I've tried removing data-validation Tag from password input but it didn't work for Reset Password, New Password, and Change Password.