Questions tagged [validation]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

After updating from 2.4.4 to 2.4.6, price field showing validation error

I just recently updated to 2.4.6, and while I was using 2.4.4 this problem never occurred. After editing/adding a price to a product, and I click out of focus of the field, I get this error: Please ...
Seth's user avatar
  • 1
0 votes
2 answers
30 views

Ui component validation remove using js magento2

I have a fieldset in my UI component. Depending on certain conditions, I show/hide fields within it. All fields are initially marked as required in the UI component. However, I want to remove the '...
Chippy Ani's user avatar
0 votes
1 answer
47 views

Add custom textbox after shipping method if freeshipping selected with validation

i've added textbox field if shipping method is freeshipping based on the shipping method textbox functionality working fine. but i want to make that field required which is not working here is my code ...
Ronak's user avatar
  • 456
0 votes
0 answers
48 views

Magento 2: how to validate after shipping address change

During checkout I need to validate the shipping address and the current cart's contents. After the customer has entered or changed the shipping address a validation should start. Depending on a ...
omsta's user avatar
  • 698
1 vote
1 answer
59 views

Magento2 postcode / zipcode length validation and remove waring complete guide

I am explaining total process in answer section
khasru's user avatar
  • 86
0 votes
1 answer
52 views

Telephone validate number but allow international + sign

In our checkout_index_index.xml file we use the following code. This works well to validate if the input is a number, but it does not allow the international sign + followed by the country code. How ...
JGeer's user avatar
  • 1,418
0 votes
0 answers
22 views

Validation field required doesn't work

I'm doing some custom fields in LayoutProcessor, method process. It add field, save, all work perfectly, but the validation is not working. I have the simple one: 'validation' => [ ...
carlos's user avatar
  • 37
0 votes
0 answers
40 views

Coupon code is not validating the customer segment condition on cart page?

I have customer segment and sku condition in the cart rule with specific coupon code. This is working fine for sku condition but this is not working for exact customer segment id. Same coupon code is ...
Vinod Kumar's user avatar
  • 2,055
0 votes
1 answer
155 views

magento 2.4 system.xml validate decimal number

I have an input type text field in my system.xml . I'd like this field to be validated in a way that the user can put numbers (0 to 9) and dots but not commas nor any other symbol. In magento, I have ...
Lou Nik's user avatar
  • 443
0 votes
3 answers
81 views

Magento2 UK phone number validation

Magento2 On contact Us page how can we validate phone nunber to accept only UK numbers?
Arjun's user avatar
  • 3,586
1 vote
2 answers
128 views

How to set a date field in a ui form to be mandatory?

I have this date field in a form (a ui component) and i'm tryig to make it "required field", I tried with <item name="required-entry" xsi:type="boolean">true</...
elunicotomas's user avatar
0 votes
1 answer
80 views

How to write custom validation rules for Magento 2 product import CSV data?

I am trying to write custom rules for Magento 2 product import data. For example Price must contain specific number of digits based on store view. How can I do such type of validations on csv data and ...
shankar boss's user avatar
  • 1,453
2 votes
1 answer
112 views

Not able to apply validation on my custom checkout step

I am trying to apply validation on my custom checkout step field but not able to do it..i want to use magento by default validations ..below is the code attached.. my-step-view.js define([ 'ko', ...
MihirBangia's user avatar
1 vote
2 answers
564 views

Remove My billing and shipping address are the same checkbox in Magento2

I want to hide the checkbox and message at the checkout that shows the message : My billing and shipping addresse are the same Without effecting the checkout procees. I wanto to remove it. I tried to ...
Rana Zain's user avatar
  • 662
0 votes
0 answers
49 views

How to make field in admin panel required

In admin panel on creating order page, i need to set field Middle Name/Initial required, if chosen shipping method is "Free shipping", otherwise, this field doesn`t need to be required. Also,...
MaxLogic's user avatar
3 votes
7 answers
4k views

Which class replace for "Zend_Validate" in Magento 2.4.6?

I have one function that uses the "Zend_Validate" Now I upgraded my Magento version to 2.4.6 and I got an error like.. https://prnt.sc/z3i-VQY7VFvp with class replace my code is if (!\...
Jay Parmar's user avatar
0 votes
2 answers
96 views

Email already exist in db validation

I need help on to correct my implementation on validating the email if it's already exists. Anyone knows what's wrong with my code? It is not validating this part. It will save even if the email ...
jsnewbie21's user avatar
0 votes
1 answer
48 views

Magento 2 validation problem (validate just the first field)

Simplify tthe code especially. Probem: only the first elemts will be validated on submit field-2 will be validated if I'll remove first field. Strange problem. Not depends of M2 vesion. That's phtml ...
Max.A's user avatar
  • 107
0 votes
1 answer
123 views

How to get value from "dynamic row field" column to another field in system.xml. How to compare this with Order Subtotal after proceed to checkout

How can to get value of "price" column in "custom Alert Message" Field. here is system.xml code ` <field id="ranges" translate="label" sortOrder="5"...
Magento beginner's user avatar
0 votes
1 answer
391 views

How can I validate the custom rule condition on custom module in Magento 2

Here I Create custom rule condition for custom module in magento 2 now i need to check that all rule at order place time I create event "sales_order_place_after" in that the rule condition ...
Jay Parmar's user avatar
0 votes
0 answers
32 views

Checkout field data validation min-words

I've set this property (min-words) on some fields at the checkout page. data-validate="{required:true, ' . "'min-words':2" . '}"' It normally works perfectly with error text and ...
AP87's user avatar
  • 197
0 votes
0 answers
215 views

Quantity Increments setting is not working in Minicart in Magento 2

We are using Magento 2.4.3. For one of the products, we have enabled quantity increments and set 3 in the "Qty increments" setting. These settings are working fine on the product detail ...
Chintan Kaneriya's user avatar
0 votes
2 answers
1k views

Checkout Page Street Custom Validation

I want to add validation to prevent code blocks or special characters like {}%.
Muhammad Hamza's user avatar
0 votes
1 answer
245 views

Check if the postcode exists in the current country on the checkout page

I want to check if the postcode exists in the current country on the checkout page. How to implement this? or maybe someone knows a module that does it? Thanks for any help
LolKek's user avatar
  • 166
1 vote
0 answers
185 views

Add custom validation for additional address field in customer account

I created a new validation role (testcaractere_speciaux_street) to eliminate specific spatial characters for the two fields address and address complement in the interface of the add address (customer ...
helmi saadaoui's user avatar
1 vote
0 answers
39 views

Disallow Comma Validation Rules

I am using this mixin for the custom validation rules in the below template for the first and last name Template: /vendor/magento/module-customer/view/frontend/templates/widget/name.phtml require js :...
Rana Zain's user avatar
  • 662
1 vote
0 answers
169 views

Custom Validation rule doesn`t works in shipping address

Hi dears I have going crazy to add a custom validation to vat field. I tried several ways, but I don't get an solve, I don't know why?! I have a module Vendor/module i have create a custom rule ...
Peren's user avatar
  • 27
0 votes
1 answer
540 views

How to add Multiple validation rule

I have to add three validation rule and as you see below code works well for one rule : validation-mixin.js define([ 'jquery' ], function ($) { "use strict"; console.log('this is ...
Peren's user avatar
  • 27
0 votes
1 answer
542 views

Custom Validation For Checkout Field

I want to add custome validation for example firstname who user can't use number But i don't know why it doesn't work I have create a module and create a file in view/frontend/web/js/validation.Js ...
Peren's user avatar
  • 27
1 vote
0 answers
44 views

Validation Name is not working

Actually, I add validation of alpha-num there it shows the Magento default validation message there. I want to add my custom message there. Validation is working app/design/frontend/Theme/CustomTheme/...
Rana Zain's user avatar
  • 662
0 votes
1 answer
343 views

How to override Validation.xml from module-customer

I want to override vendor/magento/module-customer/etc/validation.xml This validation.xml in custom module. Baically I want to change below file location with my custom module file <rule name="...
Arun Sharma's user avatar
  • 1,315
0 votes
1 answer
11 views

modify input allow_error_count in magento import

I'm new to magento development and I find myself able to modify the allow_error_count input by backend when making an import. Some clue?
Jean Pier R. Monti's user avatar
0 votes
2 answers
84 views

magento 2 : how to add excel formate validation in the input?

CSV validation working fine in existing code, so how to add excel formate in that validation phtml code:- <input data-validate="{required:false, 'validate-custom-file-csv':true}" type=&...
Darshit's user avatar
  • 53
0 votes
1 answer
643 views

Custom Coupon Code Validation

Using Magento 2.4. I need some help in tackling a task. In a store developed with Magento2 I need to create/extend the validation for coupon codes. This particular store relies heavily on coupon codes ...
LRMD's user avatar
  • 1
0 votes
2 answers
103 views

Field number validation

I need to validate a field in a custom form. The field should be not required, and should validate if the content entered in it are numbers. I added the validation on the form which works. What does ...
mrcl's user avatar
  • 37
0 votes
1 answer
146 views

How to translate Validation field name in magento 2

how to translate the field name in magento 2 that comes in %
Manjit's user avatar
  • 1
2 votes
0 answers
526 views

Magento 2 REST API Add validation for data interface payload

I have created a custom REST API to save data into my table. My table contains many fields so I am using the DataInterface structure for payload. Now I need to add a validation like as below { "...
Jancy Abraham's user avatar
0 votes
1 answer
522 views

Adding custom validation for vat_id in the checkout

I have this plugin: public function afterProcess( LayoutProcessor $subject, array $jsLayout ) { ... if(isset( $jsLayout['components']['checkout'][...
Attila Naghi's user avatar
  • 4,013
0 votes
1 answer
799 views

Magento 2: Custom Checkout Field Validation

I have a module already built for ExtraFee, I just want to add the checkbox below for terms & conditions so I found a template and added a checkbox like this: <div class="field amexfee-...
Partab Saifuddin Zakir's user avatar
0 votes
1 answer
948 views

Remove field validation and make field optional in the form

Is there a way to validate form fields, that should remain "optional" (not required)? Even if I set "required" to false in both cases (required or not), Magento nags at the ...
fkowh's user avatar
  • 3
1 vote
2 answers
556 views

error on import "The source file moving process failed" magento 2

I am getting the error "The source file moving process failed." when trying to perform any type of import. I have tried catalog re-index, tried changing the file, been searching but cant ...
ugo roubzy's user avatar
0 votes
3 answers
336 views

Magento 2 : add extra validation rules for an existing shipping carrier

This question is about javascript carrier validation in the checkout page. Depending on the validation result, some carriers may disappear from the displayed list if validation failed for them. I ...
LittleBigDev's user avatar
0 votes
1 answer
649 views

Please enter a valid credit card type number

we have Magento 2.25 and recently it stopped accepting credit cards. We were originally using authorize.net and when a user enters a credit card number it comes back with an error that says "...
nliebrand's user avatar
0 votes
0 answers
201 views

Remove form loader or spinner in shipping address one page checkout

How do I remove the page loader or spinner when user entered value in the field i.e Phone Number field? I believe this is the default design by Magento to check on the validation part or making ajax ...
Ayeh's user avatar
  • 1
0 votes
0 answers
96 views

Magento 2 : Disallow Specific Phone Number

We would like to disallow some specific phone numbers, especially in the checkout. For example the phone number: 0000000000 or 1111111111. How can we disallow these phone numbers?
JGeer's user avatar
  • 1,418
1 vote
2 answers
4k views

Magento 2 does not allow Special characters in First Name & Last name even though the Input Validation is None

In my magento setup I am not able to insert special characters for customer First name and Last name. The Input Validation for Customer Attribute First Name and Last Name is NONE. But still Magento 2 ...
Kaushik Kumar Roy's user avatar
0 votes
0 answers
73 views

Magento 2 Klarna Checkout Validate class not found from basename 'NotEmpty'

I have installed magento2 klarna checkout in my system but getting below error. any one have idea how i can solve this ?
Sanjay Shiyal's user avatar
0 votes
1 answer
496 views

Magento 2 code validation "Unescaped output detected." when calling Product Attributes in phtml

I've created Magento 2 modules, now when I trying to validate my code with Magento code validator and I`m getting 'Unescaped output detected' in phtml templates where calling custom HTML attributes. ...
Develop_Milen's user avatar
1 vote
1 answer
544 views

Magento 2 Custom adminhtml validation rules doesn't work

Custom adminhtml validation rules from Magento 2 docs on purely installed Magento 2.4.3 and Magento 2.4.2 doesn't work. Vendor/Module/view/frontend/requirejs-config.js var config = { config: { ...
Victor S.'s user avatar
  • 295
3 votes
3 answers
2k views

Magento 2 - Dynamic custom validation error message not working

i'm using Magento 2.4.1 and i add custom validation with a custom error message to detect which character is wrong and add it to the message: define([ 'jquery' ], function ($) { return ...
jojo's user avatar
  • 39

1
2 3 4 5
10