ajax submit and form plugin!
hi im using now this plugins for ajax submits
http://malsup.com/jquery/form/#api
but i have a small problem with it my coe looks like this:
-
<script type="text/javascript">
$(document).ready(function() {
$('#profedit').ajaxForm(function() {
$("#msgbox").removeClass().addClass('messageboxok').text('Done').fadeIn(1000);
});
});
</script>
everything works fine but i need a if statement here now...
in the php script is there a statement like this:
-
if (strlen($chpassword) < 5)
die("1");
if ($chpassword != $passagain)
die("2");
mysql_query("UPDATE users SET blabla);
echo "3";
and i must now merge the first javascript code with this
-
if(data=='1')
$("#msgbox").removeClass().addClass('messageboxerror').text('Sry Pass to short').fadeIn(1000);
if(data=='2')
$("#msgbox").removeClass().addClass('messageboxerror').text('Sry Pass dont match').fadeIn(1000);
if(data=='3')
$("#msgbox").removeClass().addClass('messageboxok').text('profile updatet').fadeIn(1000);
it seems that ajaxForm() returns only true/false and no data ... can someone help me plz