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
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.
1
vote
0answers
35 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
116 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', { ...
1
vote
0answers
307 views

Custom form field not showing validation message

I have created one custom form and implemented magento validation. Magento validation works for all fields but message of one field is not displaying. I have added datepicker in this field. Below is ...
1
vote
1answer
743 views

magento 2 - add max length for input fields in Review & Payments/billing form

I am trying to limit number of allowed characters on Firstname input field in my payment methods on Review & Payments area. I am using the magento default check/money order payment method. ...
1
vote
0answers
24 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....
1
vote
1answer
841 views

Magento 2 - Please enter less or equal than 255 symbols valiadtion error in checkout page

Magento 2 - Please enter less or equal than 255 symbols error message in add new shipping address popup form Currently i am getting an error validation message when i open the add new address form to ...
1
vote
1answer
1k views

How to do form validation in Magento 2?

I have added custom form in customer account navigation. Looking for code to form validation. is there anything like form-validate like in magento1? I have used in magento1 like below. var ...
1
vote
2answers
488 views

How to do the server side validation for login form?

I have done client-side validation but how to do the server side validation for the login form.
1
vote
1answer
464 views

How to hide specific days from admin form calendar field in magento 2

I want to disable week days (Saturday & Sunday) in admin form calendar field. check below screen-shoot. Below is my field code. $fieldsetDirector->addField( 'attendance', 'date', ...
1
vote
0answers
51 views

Magento 1.8.x: Validate 'Add to Cart' Button on Category View

I'm trying to add form validation on the category view and to show error message on the category page. Currently, if there's an error it will redirect you to the product view page and display the ...
1
vote
0answers
278 views

Magento 2 : How To Customize Validation Error Message

Is there a way to add a custom error message to a custom validator? I use already the default rule required-entry, can I define my own rules? and where exactly? I found something with overwriting ...
1
vote
0answers
20 views

Magento 1 - Custom required formfield on checkout

I have added a custom textarea field on the shippingmethode section. That field needs to be required. Is there any way to do this? Basicly it has this content; https://jsfiddle.net/bbsrsbbd/1/ <...
1
vote
0answers
902 views

How to remove validation error message upon input field change?

I have installed a module that adds another payment method, which has additional input options, and I want to make those options mandatory. I've added a validator to validate #co-payment-form's input ...
1
vote
0answers
40 views

Addrees field validation label not showing required mark

Hi i have a shipping address form with fields like following image. In which street address field is required field but it don't have star mark. I want to add red star after label but i didn't found ...
1
vote
1answer
380 views

Magento 2 - Single Time Picker error on save

I have already added new form field - time picker. When I'm trying to save form, post value is overridden on "Invalid date". <field name="flight_hour" formElement="date" sortOrder="40"> ...
1
vote
1answer
458 views

How to add unique mobile number function in Magento 2 registration form?

I used this link How can i add a field mobile number at the time of customer registration form in magento 2? to add mobile number field in the registration form which works fine. But I need to ...
1
vote
0answers
55 views

Input fields goes missing in Sales Order Form when there is error

I am creating a new order from admin panel i.e Sales -> Orders -> Create New Order After filling the form when i hit submit order it throws error but the input fields in FORM which i already have ...
1
vote
0answers
165 views

Magento 2 : Required fields in checkout are no longer required

I have a strange issue in Magento 2 (2.1.9), and I was wondering if anyone encountered something like this before. The required fields in the checkout usually have a required-class, but for some ...
1
vote
1answer
602 views

How to change data-validate attribute of a field?

I have a following form <form name="addForm" method="POST" enctype="multipart/form-data" action="someurl" data-hasrequired="<?php echo __('* Required Fields') ?>" data-mage-init='{"...
1
vote
2answers
1k views

Form validation with numeric rules

I'm trying to validate input field in Magento 2. I have added js to same page, so validation like this data-validate="{required:true, 'validate-email':true}" works. But how to validate ...
1
vote
1answer
523 views

Remove fields from registration form

I'm trying to modify my registration form on Magento removing the firstname, lastname and the password confirmation. At the moment I've changed the "is_required" in the "eav_attribute" table for ...
1
vote
0answers
91 views

set min and max values for a field dynamically based on the value of drop down selected in magento

https://jsfiddle.net/05Ldg6uv/6/ I tried using angularJs referring the above link but the min and max fields did not get set in magento. $setup->addAttribute('customer', 'nickname', array( '...
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
0answers
2k views

Magento 2: Checkbox Validation

I have displayed a frontend form. The form has a checkbox field and it is a mandatory field. But the validation for the field is not working. Please help. This is my phtml file: <div class="field ...
1
vote
0answers
1k views

Magento 2 checkout input field validation possibility

I have searched in web two days how to validate checkout fields without any luck. All the research I have made have risen some questions because tutorials I have found are all about custom-form ...
1
vote
2answers
32 views

Made a custom form module, form commits to database before entering values

I have made a custom form module. However, the module already commits the "values" when I enter the page instead of after entering values and pressing on "submit". So every time I refresh the page my ...
1
vote
1answer
473 views

To add one single validation for checkbox group and input field

I have created a custom form in magento 2. I have placed a checkbox group having different company names as checkbox values like cmpy1, cmpy2, cmpy3 etc. I have also added an input field inside that ...
1
vote
0answers
135 views

Magento product detailed page Varien form hidden field validation not working

I have work with Magento1.9.3, then in my product detailed page i have added some hidden dropdown fields. When i was used the Prototype(1.7.0) js, the hidden field validation was wroked without any ...
1
vote
0answers
46 views

Dont allow advanced search to click “search” without enter any search term

by default magento advanced search allows to click the search button without even enter some search words. In my magento this leads to a few seconds of waiting until you finally get a "no products ...
1
vote
0answers
721 views

magento2 admin form validation

Could somebody help me to apply form validation directly in admin html files? Here is my code for example: <form method="post" id="commercial_invoice_create_form" name="...
1
vote
0answers
740 views

how to create custom contact form based on base contact form in magento

I am creating a order form i used default magento contact form add many extra fields also defined in admin but how can i link form with template in admin ? because i want contact us form should stay ...
1
vote
1answer
1k views

Magento 2 - jQuery validation custom error message

I have the following input that requires validation. When the remote method is failed, it displays an error message Please fix this field.. How can I customize this message? <input type="text" ...
1
vote
0answers
738 views

Magento 2 - Form Validation Translation [duplicate]

I have a problem with magento 2 forma validation translation. Not all fields are translated. (The Geburtsdatum and E-Mail field) In my translation file de_DE.csv "Please enter a valid email address ...
1
vote
1answer
556 views

First Name and Last Name not allowing to use Latin letter

I am Using Magento 1.9.1 Gómez nº these letters are not allowing in my customer form. please help.
1
vote
1answer
2k views

DOB Validation with three fields in magento2

I need to change the "date of birth" field from date picker to three fields with validation. How to do it?
1
vote
0answers
122 views

Magento doesn't validate my select field

I am using two custom extensions in my Magento checkout process. One that makes a nice onestep checkout without the different steps, and one that allows the customer to choose a pickup point for ...
1
vote
0answers
570 views

Getting validation error on checkout billing tab for custom attribute

I have added two custom attribute named as country_code and mobile. And added those fields in app\design\frontend\base\default\template\persistent\customer\form\register.phtml And the fields ...
1
vote
0answers
797 views

Magento prototype validation in add to cart

I'm developing a custom theme for Magento and I have my product page with two select drop downs. My question is add to cart form validates with prototype client side validation but does not give any ...
0
votes
2answers
2k 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
1k views

Digits Range Validation in the UI-form

How to add digits range validation rule to the input field inside the UI-form?
0
votes
2answers
4k views

Magento 2 - Validate input number and allow only two digits after decimal point and submit form via AJAX

Code Snippet <form data-mage-init='{"validation": {}}' data-hasrequired="<?php echo __('* Required Fields') ?>" name="vendor" method="POST" id="vendor" autocomplete="off"> <...
0
votes
1answer
537 views

How to add addition script to existing validation class

I need to increase the validate-password class length to 8 characters. How can I add that script in that validate-password class? Note: I don't want to create a new validation class I don't want ...
0
votes
2answers
54 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
96 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
3k views

Magento 2 form validation - accessing mage/validation/validation.js return values?

This is my first go at a Magento 2, so please bear with me. I want to add functionality that scrolls the page to an error message if a form does not pass validation. Currently, I am listening for a ...
0
votes
1answer
32 views

Add extra validations to user signup

I need to add extra validations to user signup page. Currently user can enter characters to phone and fax fields. I want to prevent that from happening. How can I add those jquery parts? Where should ...
0
votes
1answer
75 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
2answers
438 views

Validtaion is not triggers in custom form in magento 2

I have created custom form inside the popup. without filling the form, i am trying to submit,immediately it submits the data instead of validating the fields. Plaese provide me a solution. form.phtml ...
0
votes
2answers
2k views

How to add custom js form validation with custom error message in magento2?

I am trying to do a custom js validation for a form field, I added this in my phtml file : var theForm = new VarienForm('form-validate', true); Validation.add('validate-testx','You failed to enter baz!...