Landslyde Posted February 4, 2015 Share Posted February 4, 2015 I have a form. I have error-catching set up for the form inputs. And in the form, I use the <h3> tage to position a captcha. the bottom part of my form looks like this: <form method="post" class="subform" action="<?php echo htmlentities($_SERVER['PHP_SELF']);?>"> ... <p> <label for="pwd2" class="label">Confirm Password:</label> <input type="password" name="pwd2" placeholder="Confirm Password" value="<?php if (isset($_POST['pwd2'])) { echo $pwd2; } ?>"> <span class="error"> <?php echo $pwd2Err;?></span> </p> <?php echo '<h3>'.$funcaptcha->getFunCaptcha("XXXXXXXX-XXXX-6849-XXXXX-XXXXXXXXXXXX").'</h3>'; ?> <input type="submit" value="Register"></button> When an input error occurs, the error text is placed next to the input box. I like that. But I don't know how to setup and display an error next to the captcha if the user fails to complete it. So I've been using $pwd2Err to tell the user it has to be be completed, but using that places the error msg next to the Confirm Password textbox, instead of next to the captcha where it should be. And for all I know, I may be in the wrong forum with this being a CSS issue instead Any ideas how I might get the error message attached to the captcha and display it accordingly? Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 4, 2015 Share Posted February 4, 2015 You could have your server generate two different error variables, and add <span class="error"><?php echo $captchaErr;?></span> wheree ver you want. Quote Link to comment 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.