![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
29/11/2008, 18:24
|
| | Fecha de Ingreso: noviembre-2008
Mensajes: 100
Antigüedad: 16 años, 2 meses Puntos: 1 | |
Respuesta: Ayuda con el script Ahí dejo el codigo fuente:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder - http://www.wysiwygwebbuilder.com">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="wb_Html1" style="position:absolute;left:203px;top:95px;width:292px;height:403px;z-index:0" align="left">
<script language="javascript">
function jsRegistrar()
{
var Nom = document.getElementById('Nom').value;
var Cognoms = document.getElementById('Cognoms').value;
if(Nom == ""){
alert("Has d'ingresar el teu nom");
document.getElementById('Nom').focus();
if (no_pasa_la_validación) return false;
}
if(Cognoms == ""){
alert("Has d'ingresar els teus cognoms");
document.getElementById('Cognoms').focus();
if (no_pasa_la_validación) return false;
}
}
</script>
<script type="text/javascript">
function verify_passwords(password1, password2)
{
// do various checks, this will save people noticing mistakes on next page
if (password1.value == '' || password2.value == '')
{
alert('Escriu la contrasenya i la seva confirmació.');
return false;
}
else if (password1.value != password2.value)
{
alert('Les contrasenyes no concorden.');
return false;
}
else
{
var junk_output;
md5hash(password1, document.forms.register.Contrasenya_md5, junk_output, 0);
md5hash(password2, document.forms.register.Contrasenyaconfirmacio_md5, junk_output, 0);
return true;
}
return false;
}
function verify_emails(email1, email2)
{
// do various checks, this will save people noticing mistakes on next page
if (email1.value == '' || email2.value == '')
{
alert('Escriu l´email i la seva confirmació.');
return false;
}
else if (email1.value != email2.value)
{
alert('Els emails no concorden.');
return false;
}
else
{
var junk_output;
md5hash(email1, document.forms.register.Email_md5, junk_output, 0);
md5hash(email2, document.forms.register.Emailconfirm_md5, junk_output, 0);
return true;
}
return false;
}
</script>
<form action="registrar.php" name="Formulari" method="post" onsubmit="return (jsRegistrar(), verify_passwords(Contrasenya, Contrasenyaconfirmacio), verify_emails(Email, Emailconfirm));">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tr>
<td class="tcat">Registrar-se a la web de l´AMPA</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:640px" align="left">
<div class="smallfont" style="margin-bottom:3px">
Si et registres, rebràs les ultimes noticies i informacions directament al teu correu
</div>
<div class="smallfont" style="margin-bottom:3px">
<strong>Nom</strong>:<br />
<input type="text" class="bginput" name="Nom" size="25" maxlength="" value="" id="Nom" style="width: 212px" /><span id="Nom"></span>
</div>
<div class="smallfont" style="margin-bottom:3px">
<strong>Cognoms</strong>:<br />
<input type="text" class="bginput" name="Cognoms" size="25" maxlength="" value="" id="Cognoms" style="width: 212px"/><span id="Cognoms"></span>
</div>
<fieldset class="fieldset">
<legend>Contrasenya</legend>
<table cellpadding="0" cellspacing="3" border="0" width="400">
<tr>
<td colspan="2">Introduix la contrasenya per a la teva conta</td>
</tr>
<tr>
<td>
Contrasenya:<br />
<input type="password" class="bginput" name="Contrasenya" size="25" maxlength="50" value="" onblur="varfield(1);" id="password_1"/>
</td>
<td>
Confirmar Contrasenya:<br />
<input type="password" class="bginput" name="Contrasenyaconfirmacio" size="25" maxlength="50" value="" onblur="varfield(2);" id="password_2"/>
</td>
</tr>
<tr>
<td colspan="2">
<span id="password_1_status"></span>
</td>
</tr>
<tr>
<td colspan="2">
<span id="password_2_status"></span>
</td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Direcció de Correo Electrònic</legend>
<table cellpadding="0" cellspacing="3" border="0" width="400">
<tr>
<td colspan="2">Escriu una direcció de correu vàlida.</td>
</tr>
<tr>
<td>
Direcció de Correo Electrònic:<br />
<input type="text" class="bginput" name="Email" size="25" maxlength="50" value="" onblur="varfield(1);" id="email1"/>
</td>
<td>
Confirmar Direcció de Correo Electrònic:<br />
<input type="text" class="bginput" name="Emailconfirm" size="25" maxlength="50" value="" onblur="varfield(2);" id="email2"/>
</td>
</tr>
<tr>
<td colspan="2">
<span id="email1_status"></span>
</td>
</tr>
<tr>
<td colspan="2">
<span id="email2_status"></span>
</td>
</tr>
<input type="submit" name="registrar" value="Registrar">
</form>
</div>
</body>
</html>
Recuerdo que el problema es que la info se envia antes de que los scripts salten |