Aug 7th, 2014, 3:30 PM
OK, looks like the the first problem of not retaining the values after failed captcha was my mistake in the php code for each field.
I still need help with the second problem, how to make the page redirect back down to the section id="contact" on the failed captcha.
Corrected form is
I still need help with the second problem, how to make the page redirect back down to the section id="contact" on the failed captcha.
Corrected form is
Code:
<form role="form" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
<div class="row">
<div class="form-group col-xs-12 floating-label-form-group">
<label for="name">Name</label>
<input class="form-control" type="text" name="name" id"name" placeholder="Name" value="<?=htmlspecialchars(@$fields["name"])?>" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-12 floating-label-form-group">
<label for="email">Email Address</label>
<input class="form-control" type="email" name="email" id="email" placeholder="Email Address" value="<?=htmlspecialchars(@$fields["email"])?>" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-12 floating-label-form-group">
<label for="mymessage">Message</label>
<textarea class="form-control" name="mymessage" id="mymessage" rows="5" placeholder="Message"><?=@$fields["mymessage"]?></textarea>
</div>
</div>
<br>
<div class="row">
<div class="form-group col-xs-12">
<div><?php if (!empty($g_api_recaptcha_error)) { ?>
<p class="alert alert-danger"><span class="glyphicon glyphicon-warning-sign"></span> Your submission did not match the captcha, please try again.</p>
<?php $g_api_recaptcha_error = ""; ?>
<?php } ?>
</div>
<div><?php ft_api_display_captcha(); ?></div><div><button name="submitmemphisguru" type="submit" class="btn btn-lg btn-success">Send</button></div>
</div>
</div>
</form>