Questions tagged [custom-validation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

Magento 2 custom validation rule in UI component form field with Ajax

I have created a custom validation rule in my admin ui form using the below link https://webkul.com/blog/add-custom-validation-rule-in-ui-component-form-field/ If I use a direct condition then it is ...
Jancy Abraham's user avatar
0 votes
0 answers
45 views

VAT-ID Validation Error "Please enter a valid vat number and select a valid country"

for a client we´re using Magento 2.4.5-p1 Open Source. While creating a new customer account the customers are able to add a VAT-ID to get selected into different customer groups. For some reason thou ...
Jessica's user avatar
0 votes
1 answer
194 views

How to add data to custom validation rule?

I would like to understand how to add additional data to custom validation rule. I noticed in Magento 2 core files something like the following: validator.addRule( 'validate-...
krisjanis-a's user avatar
1 vote
0 answers
38 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
  • 642
2 votes
2 answers
590 views

Magento2: Custom validation in checkout address form

I'm trying to add a custom validation to some input fields in checkout address forms. The official guide works fine on addressbook and other forms, extending mage/validator and using addMethod is ...
kionez's user avatar
  • 31
0 votes
2 answers
1k views

magento 2.4 change input field based on selcted country in shipping address form

I need to show/hide a magento input field (so NOT a custom field) based on the selected country in the shipping address form. Shipping address form is in two places: the customer account address book ...
Lou Nik's user avatar
  • 443
0 votes
1 answer
900 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
0 answers
208 views

date range validation in magento 2 ui comonent

I have created a custom module to mark order as delivered , In my ui component file located at app/code/Namespace/Modulename/view/adminhtml/ui_component/namespace_delivery_form.xml i have the ...
Ritesh Kumar's user avatar
0 votes
0 answers
637 views

Custom Payment Method Isn't validate before click Place order button

Magento 2.3.5 version application using custom payment method module. This module refer from code here view/frontend/web/template/payment/llamacoin.html ...
junaidh's user avatar
  • 59
0 votes
2 answers
2k views

Magento 2 + Checkout Billing address Telephone Number Validation

I have created a plugin for billing address phone number validation, but it's giving me an error Exception #0 (Exception): Notice: Undefined index: dataScopePrefix in /var/www/html/test/vendor/magento/...
Yogesh's user avatar
  • 1,503
0 votes
1 answer
781 views

Custom validation for Phone number in Magento 2

I have created the custom validation method to validate telephone number to accept only numbers and (- symbols. It's working when I tried with JavaScript in HTML page but not working when applied to ...
Bojjaiah's user avatar
  • 3,992
0 votes
1 answer
135 views

How to add a green border if validation is completed when submitting the form

Magento 2 has basic validation if the field is not valid. How to add custom validation to the checkout page which will add a green border and an inscription that notifies the user of a successful ...
ann karsksya's user avatar
0 votes
0 answers
188 views

Magento 2: How to create custom validation method

I have 2 fields for Month (both fields type is number), first one is for "From Month" and second is "To Month". I want to restrict user to enter the less no. of month in "To Month" field as ...
Faisal Sheikh's user avatar
2 votes
1 answer
2k views

Magento2 : Custom Sales Rule condition and validation

I am using this article to create a custom condition in the cart rule where I want to add the stock qty including other product attributes in the rule condition. For example if product_attribute1 = ...
Purushotam Sharma's user avatar
6 votes
2 answers
127 views

Is anyone have an idea, how to convert XML to LayoutProcessor format?

Is anyone have an idea about convert XML to LayoutProcessor format? I have created a layout processor as given below. I need to only those sentence which is defined in XML. \Magento\Checkout\Block\...
Birjitsinh Zala's user avatar
1 vote
1 answer
804 views

Magento 2: Onepage checkout shipping address ZIP Code custom data validation. Zip codes from the databse

I am absolutely new with Magento. Have basic knowledge with custom modules and front-end layout updates. I need to insert a custom validation for the ZIP Code in my checkout page (One-page checkout). ...
Anjan Patra's user avatar
0 votes
1 answer
392 views

Magento 2 - Extend custom validation / add own validation rule

In Magento 1, I used the below javascript code inside of a template to add my own validation rule: // Add new validation class for the name. Also supports names with two hypen in the name e.g. Hans-...
Black's user avatar
  • 3,280
3 votes
2 answers
5k views

Magento2: custom validation Error "Uncaught TypeError: Cannot read property 'call' of undefined"

In my custom validation rules shows ' Uncaught TypeError: Cannot read property 'call' of undefined' errors!!!... . how can i do custom logic and proper validation ? Here is my Code app/...
Shafeel Sha's user avatar
  • 1,385
4 votes
0 answers
201 views

How to add custom validation on checkout page before shipping method rendering in magento 2

How to add custom validation on checkout page before shipping method rendering and if validation success then only show shipping methods or else show error message. I have already implemented this ...
Gaurav Kumar's user avatar
2 votes
2 answers
2k views

Validation for file type not working in File Upload in Magento 2 Store Configuration

I am following below Article to upload file in store configuration: https://www.mageplaza.com/devdocs/how-file-upload-sytem-configuration-magento-2.html I have defined custom backend model as ...
Khushbu's user avatar
  • 825
8 votes
4 answers
5k views

Add Custom Validation Street Address Field in backend Magento 2

I Want To Set Minimum Length Value For Street Address Field On Admin Side I want to set min_text_length = 5 For Street Address Field In Customer Address Form I am Trying To Update Attribute but ...
Ronak Rathod's user avatar
  • 6,309