Endorphin Posted August 4, 2011 Share Posted August 4, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/243829-popup-contact-form-depending-on-button-pressed/ Share on other sites More sharing options...
Maq Posted August 4, 2011 Share Posted August 4, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/243829-popup-contact-form-depending-on-button-pressed/#findComment-1251947 Share on other sites More sharing options...
mikhl Posted August 10, 2011 Share Posted August 10, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/243829-popup-contact-form-depending-on-button-pressed/#findComment-1255172 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.