![]() |
|
Contact form in hidden div - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Contact form in hidden div (/thread-5343.html) |
Contact form in hidden div - joepinelli - 2009-06-16 I'm using Zen Photo's built in contact form. Currently the form is placed in a div that's initial state is hidden. A visitor to the site can click a link that makes the div visible and they can enter their data. That all works just fine. The problem comes in when the form is submitted. The div hides itself again. If you click the link that makes the div visible the contact form is performing as it should, asking the user to confirm their submission. I know the problem is caused by the page reloading and setting the div back to it's original state. I've tried using a postback function, but I'm afraid that may strictly be an ASP command and not suitable for the php form. Does anyone have any suggestions to tell the page "if you reloaded because of a form submit, make this div visible"? Thanks Contact form in hidden div - acrylian - 2009-06-16 The easiest would be to customize the form template form.php. Place your div around the form there and add if/else check for the Contact form in hidden div - sbillard - 2009-06-16 So, you did not say which theme you were using. From the distribution, only the Effervescence+ them incorporates the contact form plugin. And it does not place the form in a hidden DIV. So I would guess that you are using something else. Anyway, don't put the form in a hidden DIV if you want it to show. Normally you would create a separate page for the contact form and link to it from wherever you wish on your other pages. Contact form in hidden div - joepinelli - 2009-06-16 sbillard, you are right I am using a custom theme. I have the contact form placed on my image.php. People click the email button and the contact form becomes visible. It works great with the exception that every time the page needs to refresh (ie for validation, confirmation, etc.) the div hides itself again. Aside from that it is working like it is suppose to, you just need to keep clicking the contact button to complete each step of the form process. So far, based off of acrylian's suggestion I've come up with this:
Contact form in hidden div - acrylian - 2009-06-16 Well, you mixed JavaScript and PHP code. That will not work this way. You need to use CSS. Create two css classes for the div in your theme's css file, one visible and on invisible. Then use it in a similar way like Contact form in hidden div - joepinelli - 2009-06-16 Thanks Acrylian. I don't know if I completely did what you were suggesting, but it is working. The div now stays up through the entire form process. I had to add an or statement for `
Thanks again for your help! Contact form in hidden div - acrylian - 2009-06-17 Ok, I forgot the "confirm" part, it was out of memory. About the mail recieve issue I don't know, tests on my host worked fine. Maybe you get into a spam queue or something. The mail is sent via Zenphoto's internal mail functions that rely on the phpmail function installed on your server. Update: I did a new test on my host and it worked fine. Contact form in hidden div - Digifoto - 2009-07-25 I experienced the lag too but it was the host in my case too. As soon as i switched the host the problem was solved. I used Hostgator |