1

I am currently using Magento version 1.9. I would like to create a form with one field of data validation against a list of finite numbers (A list that I can upload in the back-end of Magento). The user will enter a unique number to match the number on the list I've uploaded previously. In order to continue with the form, there can be a validate button to validate the number on the form before submitting the entire form. Example form screenshot below. How can this be done?

screenshot

Thank you for your time, Elvis

  • Can you someone please help? Thank you in advance. – Elvis Jan 12 '15 at 16:52
1

So I assume that this form will have a controller with an action my suggestion would be to add the validation into the php side when the form is submitted.

If there is an error when submitting the form then add the message to the session and redirect the user to the same page and show the error messages.

Have a look at how the core Mage_Customer_AccountController works when posting data.

| improve this answer | |
0

If I understand you, you can use magento form validation or can built your own.

See this and this link.

Magento uses Prototype library to manage form validation. This comes in handy, because all you need to do when writing custom form is to assign a valid class names to your input fields, and pass the form id to VarienForm object.

Or else you should follow "David Manners" answer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.