Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/09/2008, 09:14
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 20 años, 3 meses
Puntos: 43
Respuesta: popup y unterminated string literal

estoy intentandolo validar mediante javascript de la siguiente manera:
Código HTML:
<script type="text/JavaScript">
function checkForm(form) {
             var f = $('qform');
var mensaje='';
if (f.first_name.value==''){
mensaje+='falta el nombre';
}

if (f.last_name.value==''){
mensaje+='falta el apellido';
}
.....
</script> 
el tema es que nose como pasar de php a javascript estas partes:
Código PHP:
$ss trim($_REQUEST["ss1"]).trim($_REQUEST["ss2"]).trim($_REQUEST["ss3"]);
            if (!empty(
$ss) && !(
                
preg_match("/[0-9]{3}/",$_REQUEST["ss1"]) &&
                
preg_match("/[0-9]{2}/",$_REQUEST["ss2"]) &&
                
preg_match("/[0-9]{4}/",$_REQUEST["ss3"])
                ) ) {
                
$mensaje.="Please specify your SS#<br/>";
            } 
Código PHP:
if (! (
                
preg_match("/[0-9]{3}/",$_REQUEST["day_phone1"]) &&
                
preg_match("/[0-9]{3}/",$_REQUEST["day_phone2"]) &&
                
preg_match("/[0-9]{4}/",$_REQUEST["day_phone3"]) 
            
                ) ) {
                
$mensaje.="Please specify your Telephone Number (day) \n";
            }
            
            if ( !empty(
$_REQUEST["eve_phone1"]) || !empty($_REQUEST["eve_phone2"]) || !empty($_REQUEST["eve_phone3"]) || !empty($_REQUEST["eve_phone4"]) ) {
                if (! (
                
preg_match("/[0-9]{3}/",$_REQUEST["eve_phone1"]) &&
                
preg_match("/[0-9]{3}/",$_REQUEST["eve_phone2"]) &&
                
preg_match("/[0-9]{4}/",$_REQUEST["eve_phone3"])

                ) ) {
                    
$mensaje.="Please specify your Telephone Number (eve) \n";
                }
            }

            if ( !empty(
$_REQUEST["fax1"]) || !empty($_REQUEST["fax2"]) || !empty($_REQUEST["fax3"]) || !empty($_REQUEST["fax4"]) ) {
                if (! (
                
preg_match("/[0-9]{3}/",$_REQUEST["fax1"]) &&
                
preg_match("/[0-9]{3}/",$_REQUEST["fax2"]) &&
                
preg_match("/[0-9]{4}/",$_REQUEST["fax3"])

                ) ) {
                    
$mensaje.="Please specify your Fax \n";
                }
            } 

if (
$_REQUEST["depends"]=='Yes') {
                for(
$i=0;$i<4;$i++) {
                    if ( !empty(
$_REQUEST["cd_name"][$i]) || !empty($_REQUEST["cd_dob"][$i]) || !empty($_REQUEST["cd_ss"][$i]) || !empty($_REQUEST["cd_phisician"][$i]) ) {
                        
$_DATA["depends_arr"][] = array(
                            
"cd_name"        => $_REQUEST["cd_name"][$i],
                            
"cd_dob"        => $_REQUEST["cd_dob"][$i],
                            
"cd_ss"            => $_REQUEST["cd_ss"][$i],
                            
"cd_phisician"    => $_REQUEST["cd_phisician"][$i]
                        );
                    }
                }
                if (empty(
$_DATA["depends_arr"])) {
                    
$mensaje.="Please specify your Dependants \n";
                }
            } 
espero que me puedan dar una mano desde ya muchas gracias