Questions tagged [form-validation]
Denotes question related to form validation. form validation contain frontend forms, adminhtml forms, UI components based forms
303
questions
2
votes
1
answer
3k
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
1
answer
773
views
Custom checkboxes form Validation - Magento
I have 2 checkbox fields and only one of them have to be required (the first or the second)
How can I show an error message only if the 2 checkboxes are not selected.
It is possible to do that with ...
2
votes
1
answer
120
views
uiForm validation?
I found this list validation rules:
Magento 2 - Form Validation
How to use above list of validation rules in uiForm-uiComponent. Can I add it inside xml <field> tag? or at least how to set ...
1
vote
1
answer
75
views
Adding required field
I am using a module to process product returns, but unfortunatly the comment field is not required. I would like to add the check that people have to fill out WHY they return the product.
As far as I ...
1
vote
0
answers
760
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 ...
0
votes
1
answer
1k
views
How to scroll to first error in Magento 1.9 product page?
Hi guys I would like to scroll to the first erroneous input on the product page. Currently it doesn't and stays at the bottom.
You then have to manually scroll up till you see the swatch option group ...
1
vote
1
answer
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" ...
3
votes
1
answer
4k
views
Magento 2: Image Upload JS Validation
I'm going to upload one image. I need to put below validations on Client side & Server Side
Allowed file formats: jpeg, jpg, png
Max. File Size is 5MB.
Image size should be 100 Width x 100 ...
1
vote
1
answer
266
views
Magento 2: Image Upload Not Calling Validator
I'm using Magento 2 CE Version 2.1.0. I would like to validate that uploaded image should not exceed 5MB.
app\code\Custom\Module\Controller\Posts\Post.php
public function execute() {
$uploader = ...
1
vote
3
answers
9k
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">
...
1
vote
0
answers
874
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
1
answer
3k
views
Form validation with Custom error placement in magento2
In my form i need to show validation message of specific field in my predefined or specific div, how to do it in Magento2?
1
vote
1
answer
1k
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
1
answer
1k
views
M2: Custom form validation
I have an ajax form I need to call before allowing user to continue to add a product to cart. I have the form popping up but I also need to validate the contents before it submits. However the ...
0
votes
1
answer
168
views
Delete Phone Number validation, Error in Forms
I want to remove phone validation from this form below, it's not accepting any phone number, the file is smiple_contact.phtml but I am not sure what code to delete. Thanks.
http://www.b2zee.com/b2c/...
0
votes
1
answer
275
views
Unable to validate magento custom login form in fancybox
I am trying to validate the following form in fancybox popup but it keeps on submitting the form instead of doing the validation what am I doing wrong in this? This works perfectly when Outside ...
0
votes
1
answer
1k
views
How to use Magento's default form validation in a pop-up?
I have a form in a popup that I've been trying to use the default Magento validation with. I tried various tutorials with no luck. Even tried HTML5.
What happens is if someone just clicks the submit ...
1
vote
1
answer
719
views
International phone numbers validation
I've tried many regex, but I'm still not able to find the one for accepting these kind of phone numbers:
003466655544
and
+34666555444
and
(+34)666555444
3
votes
1
answer
3k
views
Adding custom global javascript validation
I have done some digging in internet but I haven't found any confirmed solution. What is the way to add custom js validation rule, that can be used globally as for example frontend_class for ...
3
votes
1
answer
4k
views
Error in validating minimum length for text field
I have used the below
<input type="text" value="" class="input-text required-entry validate-number validate-length minimum-length-4 maximum-length-8" title="Purchase Order" name="custom1" id="...
7
votes
2
answers
15k
views
Form Key Value in template and controller
The following function is used to get the form key in templates with type hidden. My customerController.php does not validate the form key with the method _validateFormKey(). When I echo the following ...
4
votes
3
answers
26k
views
Magento2: How to validate form and display error message below input field
In magento 1.x we use the following code to validate Magento forms:
<script type="text/javascript">
var myForm= new VarienForm('contactstore', true);
</script>
I am using this code ...
2
votes
1
answer
3k
views
how to add custom validation to product options field?
I'm trying to add custom validation to the product option, I'm following the tutorial
and here it says to add custom validation element to the attribute data-validate like data-validate="{required:...
2
votes
2
answers
3k
views
Remove validation from city field in checkout
How can I remove the validation from city field which says, "Please use letters only (a-z or A-Z) in this field". I have checked the extension files but I can't find anything there.
1
vote
1
answer
3k
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?
6
votes
3
answers
26k
views
Magento 2: phone number validation (only accepts numbers)
In Magento 2, I want to make phone fields number validation, (eg in the checkout page) only accepts numbers (and not characters)?
3
votes
2
answers
3k
views
Magento 2.0 Make Javascript Required Field Validation Conditional
is it possible to make data-validate="{required:true}" conditional? I need to make the validation trigger only if Synch To Rahaha dropdown field is YES. What changes are needed to make it happen?
1
vote
1
answer
2k
views
Ajax form submit: Magento redirects to controller instead processing response
I'm working on a newsletter signup form (following this tutorial). When I hit the signup button Magento redirects me to the "form action url" and displays the response on a white page only:
{"message"...
4
votes
1
answer
2k
views
Magento-2 Validate input field without form
How to validate email input field without form? I have tried with below code but not working.
<input class="input-text"
type="email"
data-validate="{required:true, 'validate-email':...
2
votes
1
answer
3k
views
Magento 2: Form Validator is not a function
I am trying to use the new Magento 2 version and I have discovered that the form validator doesn't work as well.
When I try to add a product in the amdinistration panel I get this error:
Uncaught ...
1
vote
1
answer
641
views
Magento form validation
When using jquery .change on an input the event will only be fired when the input loses focus
In my case, I need to make a call to the service (check if value is valid or empty) as soon as the input ...
0
votes
2
answers
7k
views
How to make google reCaptcha mandatory on contactus page
I have set up google reCaptcha on contact us page but i dont know how to check its mandatory on submit for any other way.
0
votes
2
answers
3k
views
How can I change validation for registration form
I want to change the firstname and lastname field validation in registration form.
I want first name and last name should be only characters with maxlength 15.
And in which file I can find the code ...
2
votes
1
answer
123
views
conforming form validation in magento
I need to confirm either my is validated or not.My form is
<form action="<?php echo Mage::getUrl('abc_checkout/cart/placeorder'); ?>" method="post" id="confirm_order_form" class="info-...
1
vote
2
answers
1k
views
I'm getting "" is a required value on Magento checkout page
On Magento V1.9 on the checkout page (onepage). When filling out the billing page and clicking submit. I get this error:
"" is a required value
"" is a required value
I am lead to believe ...
3
votes
2
answers
3k
views
validate-select not working
I have this form where validation for upload file works but validation for dropdown isn't working.
<form name="designer-upload" class="designer-uploads form-group" id="designer-upload" action="...
1
vote
2
answers
4k
views
Magento2 - How to execute validator on form
I've extended the register form with some AJAX functionality and added a custom validator method decribed here. Now I want to execute the validation process after getting the result of the AJAX call.
...
3
votes
5
answers
22k
views
Validate input filed without form
I really need to have custom or even magento validation for my input field.
Problem is, there is no form in my field, there is only input field.
<input id="item_custom_payment_" name="...
1
vote
1
answer
707
views
How can I bypass _validateFormKey securely?
I am allowing WordPress to load Magento widgets by overriding Mage_Widget_Adminhtml_Widgetcontroller as shown below. I'm ensuring that a user is logged in as admin, but am I opening up myself to ...
37
votes
7
answers
101k
views
Magento 2 - Form Validation
is there a overview for the new form validation attributes in Magento 2?
12
votes
2
answers
8k
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
1
answer
61
views
Is it possible to write form validator which can process two different elements?
I need to do a validation on form submit, Which needs values from two different fields in the same form. I thought I will write a validator for one element and will read other element value with ...
0
votes
1
answer
33
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 ...
5
votes
0
answers
965
views
CE 1.9.2 - Date of Birth validation at checkout not working [closed]
I cannot for the life of me understand what is happening with the Date of Birth field in Checkout or Registration. I've set it as Required under Customer Configuration, and have the date fields order ...
0
votes
1
answer
347
views
Magento textbox custom validation
I Need a custom form validation in a textbox
The value should be like this 3-5, so <number>-<number>
Please suggest me some ideas
2
votes
1
answer
249
views
Customer Login, Registration, Forgot password on single page
By using this link , I have displayed customer login, registration and forgot password on a single page i.e. on login page (/index.php/customer/account/login/)
But now, for login and registration ...
5
votes
5
answers
13k
views
Is there a callback I can use after a form has been validated?
I have to reflow the Foundation equalizer on a page that contains a form [contact page] - if validation failsthe form will overlap the footer with the added validation error elements.
<script ...
2
votes
1
answer
5k
views
Admin form validation - making image file upload required [duplicate]
For backend part of my extension, I am trying to make one file required. The following code is not working. It is working fine for other text fields.
$fieldset->addField('image1', 'image', ...
0
votes
0
answers
75
views
How/where do I change the getFieldParams for magento forms from required-entry to just required?
I'm TRYING to convert a magento template to use Foundation 5, running into all kinds of issues with forms.
How/where do I change the getFieldParams for magento form validation from required-entry to ...
0
votes
1
answer
854
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 ...