Showing posts with label validation. Show all posts
Showing posts with label validation. Show all posts

13 Jan 2014

Magento: Submit custom form with magento’s built-in ajax with validation

/* Magento: Submit custom form with magento’s built-in ajax with validation */
Suppose I have created a custom form and I want submit that form through through ajax funtionality with magento’s own validation style.As you know for validating(not leaving blank) a field in magento we simply use a class called class="required-entry".So I have used required-entry class to validating my form. Below is my custom form which I have placed inside view.phtml file for giving product information through email to customer. If customer will click the link “get product details” then this form will be appeared and then he can fill up the form and submit for getting details.

10 Jan 2014

Magento :Custom Form With Default Validation

/* Magento :Custom Form With Default Validation */
When I was new in magento.I had found in registration form of customer there are some default validation . I was really getting wondered that where that is ? Now I don’t like you to be wondered .That means there are some default classes available in magento which are present in validation.js file.So please the following details then you will be understood.So I have taken the below html as an example html.

1 Jan 2014

How To Validate Upload File Using Javascript

Here is my file type field and I have placed in my custom form .So I want to validate that file when user will browse any file means select any file. That event will occurred with onchange event. So I called a java script function check_photo() on onchange events.