Spice up Contact Form in Magento

Contact Form in Magento

The contact form in Magento is plain vanila that consists of name, email address and a comment textarea only. This is good for most stores, but if you want to use the Contact form for service detail enquiry or collect more data, the plain vanilla simply can’t cut it.

Spice up the Contact Form

You can add form elements such as drop-down menus, radio buttons, checkboxes and in this article we are going to show you just that.

First go to System > Transactional Emails to add a new template.

Under the Load default template, choose the Contact Form from the drop-down menu in Template

Once the template loaded, you will see the plain vanilla code like so:

Name: {{var data.name}}
E-mail: {{var data.email}}
Telephone: {{var data.telephone}}
Comment: {{var data.comment}}

We can expand it by adding “dropdown”, “radio” and “checkbox” like so:

Name: {{var data.name}}
E-mail: {{var data.email}}
Website: {{var data.website}}
Telephone: {{var data.telephone}}
Which department you wish to contact: {{var data.dropdown}}
Are you a: {{var data.supplier}} {{var data.vendor}}
Which product types you wish to discuss?: {{var data.type}}
Comment: {{var data.comment}}

Now go to your Contact form file located at template/contacts/form.phtml to add the form codes.

Below codes are from our New Green Magento Premium Theme.








Are you a?









Which product types you wish to discuss?











And the result:

magento contact form

3 Comments to “ Spice up Contact Form in Magento ”

  1. JP says:

    Hi i have tried this method and the issue i have is it creates the buttons but when you choose, you are able to choose all of them instead of having to choose one or the other

    Am i missing something? Or is this how you meant for it to work?

    Thanks for the help.

  2. JP says:

    Ok, i found the solution.

  3. wetwewafu says:

    name=”supplier” id=”supplier” value=”Supplier” />

    name=”vendor” id=”vendor” value=”Vendor” />

    notice the name in each buttons, they should be the same so that you can only select one value.

    it works something like this — select this value from this name.

    in radio button, you can only select one value each name.