Jump to content

Popup contact form depending on button pressed


Endorphin

Recommended Posts

Hi All,

 

I have been looking for hours for a solution but no joy so far.

 

I have a contact page with different names on, each name has its own contact button.

I am trying to find a way to produce a standard popup contact form but send it to the required name, address and individual subject line.

 

I don't really want to use the mailto function, I'm sure there must be an easy solution but my skills are very limited.

 

Any help would be appreciated.

 

Neil :confused:

Link to comment
Share on other sites

There are plenty of tutorials, demos, and source code on how to achieve this.  Here is a site that provides 16 different form fields with demos and tutorials on how to build them:

http://www.webresourcesdepot.com/16-free-ajax-contact-forms-for-a-better-user-experience/

 

If you are still having trouble getting it to work, come back with your code and we'll help you.

Link to comment
Share on other sites

You could create a contact form for each different person and then display the necessary contact form when the 'contact this person' link is clicked. This could be done with a little JavaScript.

 

function setState(id, state)
{
document.getElementById(id).style.display = state;
}

 

You would then give each form and id or wrap a div around each with an id like

<div id="form1">

 

All of the forms will need to be set in CSS so that they are not displayed:

#form1, #form2, #form3 {
display:none;
}

 

Then we need to invoke the JS function when the link is clicked:

 

<a href="#" onclick="return false" onmousedown="setState('form1','block');setState('form2','none');setState('form3','none');">Display form1</a>

 

The code above will create a link that will set form1 to visibly display on the screen whilst closing any of the other forms. the onclick="return false" prevents the link from refreshing the page or redirecting.

 

Hope I helped

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.