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
0
votes
0answers
14 views

Server-side validation after form submit for register page in Magento 2.3

How to use \Magento\Eav\Model\Attribute\Data\Text::validateLength to add validate. currently, I'm using the code below to validate <type name="Magento\Customer\Controller\Account\CreatePost"> ...
0
votes
0answers
9 views

How to check the number of elements in a block before submitting a form

I have a feedback form and there is a separate block in which I always have a different number of elements, since users always choose a different number of elements. How can I check before sending ...
0
votes
0answers
11 views

Magento 2 custom form in shipping address before-form not validating for registered customers

I have added a custom form in the shipping address before-form handle. This form is validating for a guest checkout process but not working for logged in customers who have already added address ...
0
votes
1answer
31 views

Magento2 - Form validate instant and add class

Is there a way to directly validate a form in Magento2.3x? So that when the input focus goes to the next input element, it automatically validates the previous input and add a class to the input? We ...
0
votes
1answer
19 views

Magento 2 how to override Magento\Directory\Block\Data using preferences?

This is my code but the block is not overrided My di file : <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
0answers
11 views

Magento 1.9 - Remove leading/trailing spaces from address fields

We have the problem that leading and trailing spaces in the address fields in the onepage checkout are causing problems when printing the shipping labels. The fields postcode and city don't seem to be ...
0
votes
2answers
43 views

how to add magento2 checkout shipping form add validate-digits-range

I am trying to override checkout_index_index.xml using below code for minimum digits : <item name="telephone" xsi:type="array"> <item name="validation" xsi:type="array"> <...
0
votes
1answer
38 views

Magento 2 : How to remove _required class for region and region_id in shipping address?

I have updated Magento 2.3.3 after that I'm getting the error in region and region_id on the checkout page. So I need to remove the _required class in the checkout shipping form. Please refer ...
0
votes
1answer
55 views

Magento 2 - How to change the error placement in a custom form on checkout page

I wish to place the error after the parent of the element being validated. I tried to change the place via error placement function like below <script> require([ "jquery", "...
0
votes
0answers
20 views

Edit checkout shipment form

After upgrade magento version 2.3.1 to 2.3.3, i face an error in checkout shipment form, there is "county and country" text field. So i need to hide "county" field in checkout shipment form. Is it ...
1
vote
1answer
108 views

Error message for email and confirm email validation

I have 2 fields in form . 1.user email 2.confirm email. If I fill on user email field and moved to confirm email field then enter wrong email i.e; not same as user email, it is showing error "both ...
1
vote
0answers
44 views

Spambot protection fake customer registration

I want to reject all the registration of fake customers with a specific domain email. Since the spambot can send the data through POST it does not enough create a new data-validate rule in the ...
0
votes
1answer
24 views

Magento2: How to customize the Billing address form?

Currently there is no validation class available in phone number field. I want to add "validate-digits" class, but I am not able to find the related file, Please help me how to do this changes so ...
0
votes
2answers
27 views

Make taxvat not required on customer registration form programmatically

I want to force taxvat field as not required on customer create form Even if i have ovrride vendor/magento/module-customer/view/frontend/templates/widget/taxvat.phtml with a plugin in my custom ...
0
votes
0answers
16 views

Checkout custom field required validation not working properly

I am trying to add custom fields on checkout page but I am facing an issue with validation. I have created fields using below code <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/...
1
vote
0answers
13 views

Ignore some field from VarienForm validate

I have a form, and it is validated by: var productAddToCartForm = new VarienForm('product_addtocart_form'); So is there any way for removing some field we want from VarienForm validate? Thank for ...
0
votes
1answer
46 views

Magento 2 How to validate new Billing address form in checkout page

Here in new Billing address form in checkout page I have fields of Zip/Postal Code, and Phone number. I added Validation for those two working fine. But its getting saved if they are Empty. How to ...
1
vote
1answer
44 views

Magento 2 - Customer name validation

On the checkout shipping section the first and last name input fields have validation on them which doesn't accept hyphens (-) or ' characters I had a look in lib/mage/validation.js but can't see ...
0
votes
1answer
197 views

Magento2: How to change the Shipping Address Form validation message?

I want to change the shipping address form validation message(Just want to replace : 'This field required' to 'Enter FirstName') in magento2 I want to change the below validation message text how can ...
0
votes
0answers
21 views

Magento 2.3.1 : Image Validation is not working in back end form

I wants to add width and height validation for image in admin form so please help me.!! Thanks
0
votes
1answer
29 views

All form submitted without trigger js validation on first time load with browser empty cache

I am facing some weird problem on my site. When i try to reload with empty cache then all the form submitted without triggering js validation. https://prnt.sc/ov6tk0 after first submit it start ...
0
votes
0answers
50 views

Add max char length in magento 2 for street address in billing and shipping

How to add max length character limit to street address textbox in billing and shipping address field in admin from creating order form in Magento 2 I am using Magento 2.3.1 Thanks
2
votes
1answer
53 views

Billing form is not updating in magento 2

I am trying to updating the checkout forms telephone field validation. I have achieved this for shipping form but in billing form it is not working. For this I have done in my di.xml: <type name=...
0
votes
0answers
138 views

Magento2.3.1: Date of birth validation issue on customer registration page

On Magento 2 Account registration page, When I create account and enter date of birth then it shows error that Please enter a valid date. I am selecting date with magento default date picker How do ...
0
votes
0answers
18 views

Magento 2 - How to change position of Coupon Validating error message?

Our coupon code text box is at bottom of the page. When we apply wrong coupon code it shows error message on top of page as shown in image. I want to change position of that error message (only ...
0
votes
2answers
79 views

Magento 2 How to disable Postal/Zip code validation from admin while edit customer?

I am facing a strange issue while adding Customer, I had filled all the fields in the customer form including Zipcode but still, I am getting error "Zip/Postal Code" is a required value. In my ...
0
votes
0answers
29 views

Magento 2 - Can I use jQuery validation rule in UI component form (in checkout page)?

According to this post: Magento 2 - Form Validation I know that we have a very long list of validation rules that available for validation used in UI component form, which is a bit different to jQuery ...
1
vote
1answer
401 views

Magento 2: How To Disable Button On Form Submit?

I'm trying to disable button after submitting form, but i'm facing some issue, when i submit black field it validate the form and disable the button... but i want to disable it on form submit ...
0
votes
1answer
60 views

Configurable product validation doesn't work correct

When I click add cart it show second option. I think it should show first option. Now it show: I think it should show like this Any help would be greatly appreciated!
0
votes
1answer
176 views

Magento2: TypeError: $.validator.methods[method] is undefined

I am getting the below error after applying the validation in my form: Magento2: TypeError: $.validator.methods[method] is undefined Here is my validation code: I have extended the customer ...
0
votes
0answers
40 views

Magento 2 Payment validation not working,Offline order from admin in Magento-2.2.6 — with Virtual Product

Magento 2.2.6 When we do order offline,Payment validation not working. I tried <?php if ($block->hasMethods()) : ?> <div id="order-billing_method_form"> <dl class="...
0
votes
0answers
10 views

Which Magento-1 core function is good to use for my custom payment module in checkout page ( after clicking the place order button)

i need to validate order process method, which function is better to validate my code after press the place order button
1
vote
1answer
1k views

Magento 2 - Do not scroll to invalid field on form validation

On the log in page, when I don't input input in fields, the error message displays focusing on the invalid input. The window scrolls upto the invalid field at the same time. I do not want the window ...
1
vote
0answers
52 views

Magento form validation doesn't work as user type in

I have added form validation for the customer address form. but the issue is, validation works when I click submit button, it should work as user types in(key-up). city text box <input type="...
2
votes
1answer
805 views

TypeError: t.validator.methods[a] is undefined issue in jquery validation in magento2

I am facing this issue TypeError: t.validator.methods[a] is undefined after adding jquery validation in my form. Here is my validation code: <script src="http://ajax.aspnetcdn.com/ajax/jquery....
0
votes
0answers
123 views

data-validate not working in magento 2

I have added Magento 2 form validation in customer address edit form Magento_Customer/templates/address/edit.phtml, but its not working for me. I have referred this link Magento 2 - Form ...
0
votes
1answer
161 views

How to remove default validation from login and registration form in magento2.2.5?

I want to remove default validation from login and registration form and add my custom validation in magento2.2.5?
1
vote
0answers
10 views

How to add required validation on a particular filed in customer add form using JS?

I have created a custom field in customer add form using ui component. I want to add required validation to that filed using JS. Please help. Thanks in advance.
0
votes
0answers
36 views

Magento 2 required attribute in custom payment option not working

I have a custom payment module with select options. I try to add 'required' to the option but it failed. I add 'data-mage-init' in tag and data-validate attribute in tag. Should I add anything on ...
0
votes
0answers
20 views

how to add custom validation rule for form in magento 2

i have two fields in form file.phtml <div class="field"> <label class="label"><?php /* @escapeNotVerified */echo __('Current quote amount') ?>:</label> ...
2
votes
1answer
282 views

only alphabet in firstname and lastname in customer registration form Magento 2

How can i add validations for only alphabets in First name and Last name fields in Customer registration form?
0
votes
1answer
76 views

Overriding the contact form module gets the fatal error in Magento2.2.5?

I have overriden the contact form module, after disabling the default contact form validation and apply my custom validation gets the following error: Fatal error: Uncaught TypeError: Argument 1 ...
1
vote
1answer
151 views

How to remove default contact form validation in Magento2.2.5?

I want to remove default contact form validation and add my jquery validation in contact form in Magrnto2.2.5? Any help would be appreciated.
0
votes
1answer
532 views

jQuery validation not working on pressing enter key in Magento2.2.5?

I have used jQuery validation, but it is not working on pressing enter key in Magento2.2.5? But works on Submit button. Refer my code. <script src="http://ajax.aspnetcdn.com/ajax/jquery....
1
vote
0answers
34 views

Magento 2.3 validate form instant

I want to validate the form on our Magento 2.3 store instant. So when a value is added into the input field, it should validate this instant and add some css class or id to the input field. In that ...
1
vote
0answers
110 views

Magento 2.3. changing form validation options loses validation messages translations

I am running Magento 2.3. In the customer create account form I changed the way validation form errors are shown in this way: var dataForm = $('#form-validate'); dataForm.mage('validation', { ...
0
votes
2answers
503 views

“Telephone” is a required value not working in customer edit form

In my customer edit form, for telephone phone, required field validation is not working when I leave the telephone field blank. The required validation works for every field except for the telephone ...
3
votes
2answers
73 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
63 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
156 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 ----

1
2 3 4 5 6