' ); //--> Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo. ' ); //--> Do you know why?"> try to republish when error occur - Forums

Forums

try to republish when error occur

AleAste 27 Jan, 2011
Hi all, i have a question..i have a form with some field and a captcha. I checked the "try to republish" so if some errors occur, user don't have to insert again the data. If a user insert a wrong captcha, he can see the error message and he has ALL the date republished, except the email field where user find this code :

<script language='JavaScript' type='text/javascript'> <!-- var prefix = 'mailto:'; var suffix = ''; var attribs = ''; var path = 'hr' + 'ef' + '='; var addy96489 = 'as' + '@'; addy96489 = addy96489 + 'das' + '.' + 'iy'; document.write( '<a ' + path + '\'' + prefix + addy96489 + suffix + '\'' + attribs + '>' ); document.write( addy96489 ); document.write( '<\/a>' ); //--> </script><script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo. <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>


Do you know why?
GreyHead 30 Jan, 2011
Hi AleAste,

You have the Joomla! Email Cloaking Plug-in enabled and it is trying to cloak the sample e-mail in the ChronoForms validation message. Disable the plug-in temporarily to check this is the problem. If you need the plug-in change the plug-ins order so that Email Cloaking runs before ChronoForms.

NB These are Joomla! plug-ins that you manage from Site Admin | Extensions | Plug-in Manager

Bob
AleAste 31 Jan, 2011
Hi, I can't find Joomla! Email Cloaking Plug-in. Could it be the Authentication - Joomla plug-in?
or could it have annother name?
thanks for your time

Francesco
AleAste 31 Jan, 2011
ok ok...i've found it... i try do do what you said..
Thanks a lot

Francesco
AleAste 31 Jan, 2011
ok...now it works =)
I have another question about server side validation..
I'm validating the form's fields...name, surname,city,email are ok. Telephone and birth year are wrong.. could you look my code if you can understand where i'm wrong?

$anno = JRequest::getString('anno_nascita','','post');     // CONTROLLO ANNO
$pattern5 = '/^([0-9]{4})$/';
if ( !preg_match($pattern5, $anno) || $anno < 1930 || $anno > 1995 ){
  $messaggi[] = "Inserire l'anno in millesimi";
}

$telefono = JRequest::getString('telefono','','post');  // CONTROLLO TELEFONO
$pattern6 = '/^([0-9]{1,13})([/\-\' ']{0,1})([0-9]{0,10})$/';
if ( !preg_match($pattern6, $telefono) || $telefono < 99999) ){
  $messaggi[] = "Inserire un numero di telefono valido";
}

this code is equal to the other function that i used for the other fields, except for the names but it doesn't work. I thought it could be because of this field are numeric... and could give problem with getString function...but i don't know.. 🙄

Thanks

Francesco
GreyHead 31 Jan, 2011
Hi Francesco,

You should probably try getInt() to limit these results to integer values.

Bob
AleAste 31 Jan, 2011
i've used getVar....now the birthdate works...
the telephone not yet...i don't know why..it's a string..
can you have a look to this code?

$telefono = JRequest::getString('telefono','','post');  // CONTROLLO TELEFONO
$pattern6 = '/^([0-9]{1,13})([/\-\' ']{0,1})([0-9]{0,10})$/';
if ( !preg_match($pattern6, $telefono) ){
  $messaggi[] = "Inserire un numero di telefono valido";
}

😶
GreyHead 06 Feb, 2011
Hi AleAste,

There's a problem with both the outer '' and the repeated /. Please try
$pattern6 = "#^([0-9]{1,13})([/\-\' ']{0,1})([0-9]{0,10})$#";

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