I am trying to make my own contact form without the aid of a plugin.
Shouldn't be that difficult so I created this template:
<?php
/*
Template Name: Contact Form
*/
?>
<?php
//If the form is submitted
if(isset($_POST['submitted'])) {
//If there is no error, send the email
wp_mail($_POST['email'], "Thank You", $_POST['digits']);
if(!isset($hasError)) {
}
} ?>
<?php get_header(); ?>
<?php
//If the email was sent, show a thank you message
//Otherwise show form
if(isset($emailSent) && $emailSent == true) {
?>
<div class="thanks">
<h1>Thanks, <?=$name;?></h1>
<p>Your email was successfully sent. I will be in touch soon.</p>
</div>
<?php } else { ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php if(isset($hasError) || isset($captchaError)) { ?>
<p class="error">
There was an error submitting the form.
<p>
<?php } ?>
<form action="<?php the_permalink(); ?>" id="contactForm" method="post">
<input type="hidden" name="submitted" value="1"/>
<label>Gift Certificate recepient's E-Mail address:</label><input type="text" name="email"/>
<label>PayPal receipt's number 4 Last Digits:</label><input type="text" name="digits"/>
<input type="submit" value="SEND"/>
</form>
<?php endwhile; ?>
<?php endif; ?>
<?php } ?>
<?php get_footer(); ?>
I made page with it the above template but the problem is that everything seems to look fine, except that I cannot click on any of the form elements. It seems as if they are locked or something. Any idea why this might be happening?
Thanks ;)
div.entryand then it worked. I didn't know it is possible with CSS to disable certain area of your page if not wrapped inside desired container?? Thanks – daniel trifunovic Feb 22 '12 at 5:22