thanks a lot, but it still doesn't work :( now i always get the error
message...

Here is the code of checkpasse.php:

<?php
$Mdp=$_POST['edtMdp'];

$Mdp2=$_POST['edtCMdp'];


if ($Mdp==$Mdp2)
{

 echo "yes";
}
else
{

  echo "no";
}

?>



On 10 sep, 09:21, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> instead of this:
> $.post("checkpasse.php",{ edtMdp: $("#edtMdp").val(), edtCMdp: $
> ("#edtCMdp").val()}, ...
> do this:
> $.post("checkpasse.php",{ edtMdp: function() { return $
> ("#edtMdp").val() }, edtCMdp: function() { return $
> ("#edtCMdp").val() }} , ....
>
> On 10 Sep., 01:31, Littletower <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I wrote a script to verify if two text boxes have the same value/text.
> > checkpasse.php just verifies if the text box edtMdp($_POST['edtMdp'])
> > equals edtCMdp ($_POST['edtCMdp']), if they do: echo "yes", if the
> > don't echo "no"
> > so if the result of checkpasse.php is, for example,
> > "no" (datamdp=='no') then a message box will appear with a error
> > message
> > the problem: it only shows the "Vérification..." message box, line 6.
> > It looks like it doesn't check the result of checkpasse.php...
>
> > Please could you help me out here? thx
>
> > Here is the code:
>
> > $(document).ready(function()
> > {
> >         $("#edtCMdp").blur(function()
> >         {
> >                 //remove all the class add the messagebox classes and start 
> > fading
> >                 $
> > ("#msgboxmdp").removeClass().addClass('messagebox').text('Vérification...').fadeIn("slow");
> >                 //check the username exists or not from ajax
> >                 $.post("checkpasse.php",{ edtMdp: $("#edtMdp").val(), 
> > edtCMdp: $
> > ("#edtCMdp").val()} ,function(datamdp)
> >         {
> >                   if(datamdp=='no')
> >                   {
> >                         $("#msgboxmdp").fadeTo(200,0.1,function() //start 
> > fading the
> > messagebox
> >                         {
> >                           //add message and change the class of the box and 
> > start fading
> >                           $(this).html('Vérifiez votre mot de
> > passe!').addClass('messageboxerror').fadeTo(900,1);
> >                         });
> >           }
> >                   else
> >                   {
> >                         $("#msgboxmpd").fadeTo(200,0.1,function()  //start 
> > fading the
> > messagebox
> >                         {
> >                           //add message and change the class of the box and 
> > start fading
> >                           $(this).html('Le mot de passe est
> > correcte!').addClass('messageboxok').fadeTo(900,1);
> >                         });
> >                   }
>
> >         });
>
> >         });
>
> > });

Reply via email to