perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian 'cit' Adamsky <cit-embp...@spin.de>
Subject Form::Validate and Internet Explorer
Date Mon, 03 Apr 2006 12:14:36 GMT
Hello list,

I've another problem! With Embperl::Form::Validate I generate a
javascript and check if the e-mail address is valid. With firefox and
mozilla it works very well, but the internet explorer (6.0.2) always
say the e-mail address is not valid. Is the generated Javascript
incompatible?

Thanks in advance 
greets
cit

Here some code, but I don't think this can be the problem. 

## my template

use Embperl::Form::Validate;
my $epf=Embperl::Form::Validate->new([[
                                        -key => 'email',
                                        emptyok => 1,
                                        -msg => 'no valid email
address', -type => 'EMail',
                                       ]]
                                     );

<script type="text/javascript" language="JavaScript">
<!--
[+ do { local $escmode = 0; $epf->get_script_code } +]
//-->
</script>
<form action="user.tmpl" method="post" name="add_user" onSubmit="return
epform_validate_forms_0_()">

## the generated javascript
<script type="text/javascript" language="JavaScript">
<!--
function epform_validate_forms_0_()
    {
    var msgs = new Array ;
    var fail = 0 ;
    var i = 0 ;
    var obj ;

    do {
    
do {

do {
obj = document.forms[0]['email'] ; if (!(obj.value)) {  break;}
obj = document.forms[0]['email'] ; if (!(((obj.value.search(/^[^
<>()@¡-ÿ]+@[^ <>()@¡-ÿ]+\.[a-zA-Z]{2,4}$/) >= 0) &&
(obj.value.search(/@(\.|.*(\.\.|@))|mailto:/i) < 0))))
{ msgs[i++]='keine gültige E-Mail Adresse'; break;} } while (0) ; if
(fail) break ; } while (0) ; if (fail) break ;
 ;
    }
    while (0) ;
    if (i)
        alert (msgs.join('\n')) ;

    return !i ;
    }
//-->
</script>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message