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
7
votes
2answers
14k 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
3answers
19k views

Magento 2 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 ...
1
vote
1answer
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
2answers
2k 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
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?
6
votes
3answers
14k 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
2answers
2k 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
1answer
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
1answer
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
1answer
2k 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
1answer
595 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
2answers
5k 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
2answers
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
1answer
118 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
2answers
899 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
2answers
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
2answers
3k 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
4answers
14k 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
1answer
663 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 ...
35
votes
7answers
65k views

Magento 2 - Form Validation

is there a overview for the new form validation attributes in Magento 2?
12
votes
2answers
7k 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
47 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
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 ...
5
votes
0answers
906 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
1answer
227 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
1answer
223 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
5answers
12k 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
1answer
4k 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
0answers
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
1answer
680 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 ...
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 ...
2
votes
1answer
2k views

Magento admin form validation doesn't working?

I have a custom grid in Admin panel. When you want to edit entries to the grid it will load a form. The required field validations of this form are not working. I have define the fields as below. $...
2
votes
1answer
1k views

Telephone Number validation in billing and shipping on frontend?

I want the users to fill the Telephone field in a formatted way, for example, the format in my country is 03XX1234567. How can I set the field to only accept a number in this format else give an error?...
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
1answer
736 views

Product validation form jquery

I am having difficulties getting getting my form to work. I have it partially working. Fields which are required are coming up in red when not filled out. The problem is that they remain red even when ...
0
votes
2answers
1k views

By submitting forms billing and shipping, return message “Telephone this required field”

When I fill out the form and send to customer base, magento returns the message Telephone is a required field I've tried removing the validation of the phone field in HTML, JS and Databases, yet ...
5
votes
1answer
2k views

Validation does not work in admin forms

I followed the advices of https://magento.stackexchange.com/a/8785/9489 and succeed to get that : $fieldsetImage->addField('logo_big', 'image', array( 'label' => Mage::...
1
vote
1answer
1k views

How to remove Magento's password matching in account registration form?

I am creating a custom user registration page for which I copied registration.phtml to another location and I am working with it. And for that page I don't want the user to be enforced to enter the ...
1
vote
0answers
568 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 ...
0
votes
1answer
624 views

When delivery radiobutton is checked the textarea is required

On my checkoutpage I have added a deliverydate textarea. Some visitors don't fill the textarea which is a problem. I need the textarea to be required when checking the Deliver radiobutton. On ...
0
votes
1answer
1k views

Password doesn't validate when there are three forms on one page

I've got three forms on one page (checkout, step 1): login form, register form and form for people who doesn't want to create account. I've got a problem with password validation in register form "...
3
votes
0answers
454 views

Email validation in registration form to exclude example addresses

My current registration form only validates the proper input email format. Where my validation.js file has ['validate-email', 'Please enter a valid email address. For example johndoe@domain.com.', ...
3
votes
1answer
4k views

How to check all the validations are passed in magento form?

I want to check if all the validations are passed in magento billing form what i have tried is <script type="text/javascript"> //<![CDATA[ var billingForm = new VarienForm('...
1
vote
2answers
6k views

custom form validation not working

I am having form - <script type="text/javascript"> //< ![CDATA[ var customForm = new VarienForm('createstore'); //]]> </script> <form class="form-inline" ...
2
votes
1answer
2k views

How to add alphabets without space validation in magento?

There are validate-alpha and validate-alphanum-with-spaces classes in magento form validation . But how to do only validate-alpha-with-spaces ?
0
votes
1answer
2k views

require for input value on custom contact form

I am creating a custom contact form (so that my site will have two separate contact forms). I used the tutorial here However my issue is I need to set some of the form inputs to require a value. I ...
1
vote
0answers
795 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 ...
4
votes
3answers
2k views

What is the cleanest way to enforce length limitations on customer's address in admin panel?

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go ...
1
vote
1answer
901 views

Combined form fields validation

After some days off miserable testing and trying to figure out what I'm doing wrong I decided to ask it here. I'm trying to write a custom validation rule that validates the combination of 2 fields (...
1
vote
3answers
2k views

Adding validation to top search bar breaks autocomplete functionality

I have a problem where adding validation to the top search bar causes the Auto-complete to stop working. Here is the code for validation which works but breaks auto-complete. <form id="...