Page 1 of 2
Input form placement & captcha
Posted: 16 Nov 2008, 01:54
by bjamieson
Hi,
I am using the guestbook, and found it easy to install and configure - so major congratulations.
There is one improvement I would like to suggest, and that is how the form reloads when everything has been filled in correctly, except for the Captcha code.
When you make an error in the code, you get returned to the top of the page - but it is not apparent that the code was wrong.
It would be great if the form could be reloaded and it 'jumps' to the form so that you can see that you did not fill the captcha code in correctly. Could this be done using html anchor links that anchor to the form, and not the top of the page ?
best regards,
Brian
Re: Input form placement & captcha
Posted: 16 Nov 2008, 02:18
by Jan
Hi, if you type wrong captcha, the site will be redirect to the same form with all filled information and with the red message that the filled captcha was wrong ...
Re: Input form placement & captcha
Posted: 16 Nov 2008, 02:53
by bjamieson
Jan wrote:Hi, if you type wrong captcha, the site will be redirect to the same form with all filled information and with the red message that the filled captcha was wrong ...
Yup, you are right, but the only thing is, that you are returned to the top of the page. And the form (with the red error message "The Captcha code you have entered is wrong. Please, try it again") is at the bottom - that is where I want to place my form.
The problem is that a lot of people would not realise that they had not submitted their guestbook entry correctly, and might click on the menu to go elsewhere. Does that make sense ?
cheers
Re: Input form placement & captcha
Posted: 16 Nov 2008, 10:32
by bjamieson
Here is an example of what I mean :
On the site I look at the guestbook - but the 'form' is located at the bottom of the page.
I scroll down to fill in my entry - everything is right except the captcha code, and I hit submit.
The 'form' is reloaded - but I am at the top of the page - there is not indication of an error.
I need to scroll down the page to see that I did not put the code in correctly.
What would be better would be if there was an anchor to the 'form' so that when it reloads, it goes straight to the 'error' anchor and the user can see exactly what has happened.
Does that make sense ?
cheers,
Brian
Re: Input form placement & captcha
Posted: 16 Nov 2008, 20:20
by Jan
Yes, I understand you, this need to be custom made, e.g. if you know that you have the form in the bottom of the page, you should place the messages somewhere into the top but as I say it need to be custom made...
components\com_phocaguestbook\views\phocaguestbook\tmpl\default.php
// Server side checking CAPTCHA
if ($this->captcha_msg)
{
echo '<small style="color:#fc0000;">'.JText::_( 'Phoca Guestbook Wrong Captcha' ).'</small><br />';
}
//-- Server side checking CAPTCHA
somwhere into the top...
Jan
Re: Input form placement & captcha
Posted: 10 Dec 2008, 01:09
by bjamieson
Hi Jan,
I settled on the following changes :
1) Create an anchor point at the start of the form:
<a name="captchaerror"></a>
<form
action="<?php echo $this->action; ?>"
method="post" name="saveForm" id="pgbSaveForm" onsubmit="return submitbutton();">
2) I'm not a php guru (or beginner for that matter

)
So I added some javascript - I'm sure that there must be a MUCH better way to achieve this - but it works for me...
<script language="javascript" type="text/javascript">
function jumpToError(){
var captchaerr = "FALSE";
captchaerr = "<?php if($this->captcha_msg) echo 'TRUE' ?>"
if (captchaerr=="TRUE") setTimeout("location.href='<?php echo $this->action."#captchaerror" ?>'", 0);
}
jumpToError();
</script>
So it is a bit cheeky...
It sets the jump point, and if there is a captcha error, it does an immediate redirection to the anchor point. This MIGHT cause the form to be reloaded twice - but in testing it, I have seen no problems.
cheers,
Brian
Re: Input form placement & captcha
Posted: 10 Dec 2008, 17:59
by Jan
ok, thank for this solution, please let me know the site with this solution...
Jan
Re: Input form placement & captcha
Posted: 10 Dec 2008, 22:18
by bjamieson
It's not live yet - but I will let you know - the hope is it's live for the new year...
cheers,
Brian
Re: Input form placement & captcha
Posted: 12 Dec 2008, 19:22
by Jan
ok
Re: Input form placement & captcha
Posted: 27 Dec 2008, 22:41
by bjamieson
Hi Jan,
I said I would get back to you...
Currently the site is working @ the following
temporary url.
But I thought you might like to see the functionality in operation...
http://bnj.homelinux.net:8080/joomla
Cheers, and happy christmas.
Brian