submit par fonction javascript
Salut,
voil�, j'essaie d'envoy� les donn�es apr�s avoir verifier la chaine entr�e, j'avais d�j� utilis� la propri�t� action, j'ai cherch� sur le net, et puis pas trop de choses interessante, voil� ma fonction
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| function CheckSyntax(value1,value2)
{
var reg=/^[a-zA-Z0-9|@]{0,10}$/i;
var result1=value1.match(reg);
var result2=value2.match(reg);
var res="";
if(!result1 || !result2)
{
alert ("don't play with a witch"+res);
return false;
}
else
{
window.document.f_login.action.value="auth_ok.php";
window.document.f_login.submit();
return true;
}
} |
et pour le formulaire html c'est :
Code:
1 2 3 4 5 6 7 8 9
| <fieldset style="width:200px">
<legend>Authenticate</legend>
<pre>
<form name="f_login" method="post">
Login :<input type ="text" name="login" /><br>
Pass :<input type ="password" name="pass" /><br>
<input id="btn_1" type="button" value="Authenticate" onclick="CheckSyntax(this.form.login.value,this.form.pass.value);">
</form></pre>
</fieldset> |
l� je suis sous FF
/Salut