Jump to content

How to create an advanced contact form?


lbh2011

Recommended Posts

Hey everyone,

 

I am looking to create an advanced contact form but need someone to point me in the right direction.

 

I need to create a customer service form and would like it to contain the usual fields e.g. Name, Email etc. but also want to include a drop down field which has a couple of options e.g. Sales Enquiry, Order Status etc.

 

Once one of those options has been selected e.g. Order Status, I then want a further section of the form to appear where the user can input data such as their order number, order date etc.

 

Does anyone have any ideas on how to achieve this or know of any demos/scripts which they think might help.

 

Link to comment
https://forums.phpfreaks.com/topic/255881-how-to-create-an-advanced-contact-form/
Share on other sites

This is really more client side to be honest.

 

You just need some jquery and some logic within your jquery.

 

specifically you'll use the .change() function to register when a new selection has been made (i.e. from your drop down) and this would fire off the code for the new piece of the form you want to display.

 

This should point you in the right direction - http://api.jquery.com/change/

 

You could of course load the form elements using ajax but i cant exactly see why it would be worth sapping server resources for soemthing that can be done client side :)

 

 

 

Hey everyone,

 

I am looking to create an advanced contact form but need someone to point me in the right direction.

 

I need to create a customer service form and would like it to contain the usual fields e.g. Name, Email etc. but also want to include a drop down field which has a couple of options e.g. Sales Enquiry, Order Status etc.

 

Once one of those options has been selected e.g. Order Status, I then want a further section of the form to appear where the user can input data such as their order number, order date etc.

 

Does anyone have any ideas on how to achieve this or know of any demos/scripts which they think might help.

Almost finished the front end, just need to add some validation now!

 

I found a good script to show/hide content based on the selection of a drop down field - it may help someone! http://anthonygthomas.com/2010/03/14/display-form-fields-based-on-selection-using-jquery/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.