Forums

Anchor to Error Message

leolll 02 Jul, 2009
Hi Max,

On long pages where the form is below the fold, captcha errors are not visible without scrolling down. So most people will be oblivious to the error.

I've modified CF to include an anchor link like this (chronocontact.html.php around line 129):


<?php if($MyForm->formerrors){ ?>
      	<a name="error" /> // This gets added
        <span class="cf_alert"><?php echo '<ol>'.$MyForm->formerrors.'</ol>'; ?></span>
<?php } ?>


And on the captcha error redirect I changed this (chronoform.php around line 278):


$mainframe->redirect($session->get('cfreturnurl_'.$formname, '', md5('chrono'))."#error");


This way it doesn't matter if the error message is below the fold, the visitor will still see the error.
mali01 22 Apr, 2010
WOW! Thanks a lot Leoll - It works! I've been trying to add an anchor on the article above the form...

Cheers,
MALI
This topic is locked and no more replies can be posted.