Jump to content

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/294371-how-do-i-do-this/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.