Custom Login In Error Handle

markhayes 27 Mar, 2012
Hi,

I am implementing a new logon for my site on <!-- w --><a class="postlink" href="http://www.pendando.com">www.pendando.com</a><!-- w -->. Login works as I want it, but I want to capture an login error (password or user id) and output my own error message.

I have turned off JS Validation so the standard error does not appear. On the On Fail event of Joomla Login, I have a Custom Code that I am using to clear the password and user name (and display an error message somewhere), followed by an Event Loop to On Load. The custom code element contains

<?php
$form->data['username'] = '';
$form->data['password'] = '';
?>

My issue is that the username and password are not cleared. Any suggestions?

Mark
GreyHead 28 Mar, 2012
Hi Mark,

I think your code should work but ChronoForms does check various places for data when the On Load event starts so you might repeat your code in a Custom Code action there.

Is it also possible that browser is re-loading the data? if so, adding autocomplete='off' in the from tag might help.

Bob
markhayes 28 Mar, 2012
Thanks Bob,

I took a slightly different approach in the end. When an error now happens, I redirect them to a new form that has help suggestion and reset password links etc. On this form I have the space to allow out of the box validation as well.

Thanks for the help.

Mark
This topic is locked and no more replies can be posted.