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
8
votes
1answer
1k views

Error message “Please enter valid date”

I am getting an error message when I use any date field for products or coupons. It tells me to enter a valid date. The dates are valid and there is no range that satisfies the system. Some payment ...
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
1answer
668 views

Js Form Validation error disappear

I've this really strange issue with form js validation error. I've never edited anything related to it and there are no js errors in the console. The problem is that an error like "This is a ...
0
votes
0answers
9 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 ...
11
votes
1answer
2k views

Frontend form key is being overwritten

I am currently having issues with frontend forms where the form keys are somehow being overwritten and displaying incorrect form keys. I am currently debugging this issue on the customer login form. ...
12
votes
2answers
6k views

magento2: how validation work in magento2

In magento1 we can check validation like this: var formToValidate = $('form-validate'); var validator = new Validation(formToValidate); if(validator.validate()) { // Here we can code ...
0
votes
1answer
30 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 ...
3
votes
1answer
1k views

Magento registration returns 'Last name cannot be empty'

I am trying to deploy Magento 1.9.2.1. I used the package from the official site. But a strange thing happened to me. Among all the instances I deploy, it fails at any page that requires validation ...
0
votes
2answers
691 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"...
0
votes
1answer
921 views

Magento 2 Checkout Validation doesn't work

I've created a module which extends the magento 2 checkout, where I've added another field according with the magento documentation: http://devdocs.magento.com/guides/v2.0/howdoi/checkout/...
1
vote
2answers
7k views

How to submit a form to controller using ajax with magento 2 validation

My form is like this <form data-mage-init='{"validation":{}}' id="donation-request-form" method="post" data-hasrequired="* Required Fields"> <div class="row"> <div class="...
1
vote
2answers
2k views

Magento 2 remove validation dynamically

Hi I have a custom form where in I display configurable products with its options. The form is given validation using: <form data-mage-init='{"validation": {}}' data-form="quick-view-form" data-...
0
votes
1answer
18 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
10 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 ...
4
votes
1answer
7k views

UI form validation in Magento 2

I want to validate text field to numeric or not in UI form. <column name="sortorder"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> ...
2
votes
1answer
1k views

Magento2- UI Component - Remove form validation for telephone

I have tried to override the form validation for telephone which added in core file vendor\magento\module-customer\view\base\ui_component\customer_form.xml as follow: <field name="telephone"> ...
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 ...
0
votes
2answers
42 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"> <...
5
votes
2answers
8k views

Magento 2 form validation: minimum/maximum length

I'm trying to add some of the predefined validation to a form element but currently am failing. As fas as I can tell, all the validation rules can be added via classes, but no where does it say how to ...
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
50 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
5k views

Add Custom Validation Rule Magento 2 Validate.js

I am using the following code on a form to use the validation.js library to validate the form. One of the validation files uses ./rules.js to extend the rules used within the validator which I have ...
1
vote
1answer
101 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
41 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
23 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 ...
7
votes
0answers
2k views

Magento 2 : Validate form fields that are loaded with Knockout on blur-event

I have a form that is generated through a .phtml file, and in this form various fields are loaded with KnockOut (using the uiComponent javascript-object). .phtml: <form action="#" class="form ...
0
votes
2answers
77 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 ...
1
vote
1answer
378 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
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 ...
2
votes
1answer
527 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 ...
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
177 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
1answer
636 views

Changing the validation rules for all forms

I want to change the rules in all magento forms, to accept just English characters. So any non-english character in magento form should not be accepted. any suggestion how I could do it?
0
votes
1answer
27 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
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
3
votes
1answer
2k views

Magento 2 Custom Validation on Address Book (street[1])

For the checkout screen (custom OneStepCheckout plugin) I managed to succesfully add a custom validation rule on the second street input. Now I'd like to do the same for the default Address Book pages,...
0
votes
0answers
45 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
123 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
17 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
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 ...
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
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
164 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 ...
1
vote
3answers
6k views

Input value must contain number higher than 5

In my contactform I want to display a inputfield, that may only contain a number, higher than 5. How can I achieve that? My current code is: <li> <div class="field"> ...
0
votes
0answers
39 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="...

1
2 3 4 5 6