|
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-10-31 06:18:59
The CAPTCHA example uses layout-capture and display-output methods and it works fine. But when I tried the plugin with Smarty using FetchOutput(), it bombs with the message:
Error: 8
Text : Undefined index: TYPE
File : forms.php
Line : 4261
form_class PageLoad()
Here is the line 4261 in forms.php:
if(!strcmp($this->inputs[$c]["TYPE"],"custom"))
Is this an issue and how do I get around this error?
TIA
![Picture of Manuel Lemos Picture of Manuel Lemos](/picture/user/1.jpg) Manuel Lemos - 2007-10-31 06:57:18 - In reply to message 1 from Form Class
There is no reason for that to happen.
Have you changed the class code somehow?
Are you using PHP with some kind of special extension, for instance an optimizer?
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-10-31 07:39:34 - In reply to message 2 from Manuel Lemos
Manuel,
I've found the error in my code and fixed it. But I'm not getting the image displayed maybe because I use mod_rewrite to redirect requests to index.php. I see an empty image placeholder and its Address (URL) under its Properties display something like:
login?___event=getimage&___input=captcha&___image=S35gN2Sr%3A1193815535
When I run your example under another host without mod_rewrite, it works just fine. I've copied the noise.png/noise.gif into my images folder and assigned the path to NoiseFromGIFImage/NoiseFromPNGImage and tested with an <img src...> with the path and it renders the image.
Is there anything I should do to get it to display the image?
Regards,
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-10-31 08:12:57 - In reply to message 3 from Form Class
Manuel,
Sorry I forgot to invoke HandleEvent() - the image now displays.
I notice that an enter-key press from the captcha text input does not trigger a click on the form's submit button so the user needs to click the submit button using the mouse or tab back to the user/password fields to press the enter key. I hope you have a workaround for this UI behavior.
Further, the font-size does not increase on setting the Font attribute to 4, 5, 6, etc - it just makes it bold.
Also, is there a way to render a border around the image for a visual cue? I tried:
'STYLE' => 'border: 1px'
but it does not work.
Thanks,
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-10-31 10:21:42 - In reply to message 4 from Form Class
OK! I've figured out the border around the image.
I notice that if image validation text expires and ResetIncorrectText is true, it does not reset the input-text as it does when validation fails. This is a bit inconsistent as a new image is regenerated on expiration but the input-text remains as the old submitted value requiring the user to clear it out to type the new image text.
I still couldn't figure out a way to resolve the enter-key behavior and font-size in the image.
Thanks,
![Picture of Manuel Lemos Picture of Manuel Lemos](/picture/user/1.jpg) Manuel Lemos - 2007-10-31 17:55:01 - In reply to message 4 from Form Class
The enter key event was disabled on purpose because it would trigger a click in the redraw button instead of the real form submit button.
As for the font size, that is under the control of GD library. The class just renders the text as it. If it does not get to the size of the library, just open a new font with GD functions.
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-10-31 18:35:04 - In reply to message 6 from Manuel Lemos
Manuel,
On my form, the form-submit button appears on the top before the captcha's default Redraw submit-button and I see the form-submit button is highlighted (default) on setting focus to the form inputs. If I could enable the enter-key behavior somehow, will it still submit the Redraw button instead of the highlighted form-submit button that is rendered first on the top?
If I want to hide the Redraw button and render my own Redraw "button" input, how can I enable the enter-key behavior to submit the form? I see this code in the captcha class which might be disabling the enter key behavior:
$input_arguments=array(
"NAME"=>$this->text,
"ID"=>$this->text,
"TYPE"=>"text",
"ValidateAsNotEmpty"=>1,
"ValidationErrorMessage"=>$this->validation_error_message,
"ONKEYPRESS"=>"return(event.keyCode!=13)"
Is there a setting to enable the enter-key behavior?
2. I hope you would find some time to reset the input text on expiration if ResetIncorrectText is true.
Regards,
![Picture of Manuel Lemos Picture of Manuel Lemos](/picture/user/1.jpg) Manuel Lemos - 2007-10-31 21:11:14 - In reply to message 7 from Form Class
I will try to improve that for the next release.
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-11-01 02:44:47 - In reply to message 7 from Form Class
Manuel,
Here are a few more improvements that I noticed compared to other CAPTCHA solutions:
1. When captcha fails validation, displays only the captcha validation error but not the errors of other inputs that also failed validation.
2. If captcha passes validation, then it displays errors of other inputs that failed validation.
3. Need to reset input text and regenerate a new captcha image on validation failure of other inputs (but not the captcha) instead of carrying over the previously generated captcha image and input text intact. This happens when captcha passes validation but other inputs fail validation where the image/input-text remain the same on the next page. The purpose here is to force the user to re-enter captcha input text on validation failure of any input - not just captcha failure.
Regards,
![Picture of Form Class Picture of Form Class](/graphics/unknown.gif) Form Class - 2007-11-01 02:50:39 - In reply to message 9 from Form Class
5. Another feature would be to just return the CAPTCHA text instead of generating an image - for use in RIA where we don't need to render it as an image. This would improve the server's performance on processing cycles, too.
6. Ability to enable the enter-key behavior.
Most of these suggested features could be offered as configurable attributes.
TIA
|