mam sobie js
function vaildUser() {
var u = $('#bmd_cun').val();
var e = $('#bmd_cem').val();
var errors = 0;
if(u != '' && e != '') {
var Response = $.ajax({ type: "GET", url: "<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/<?php echo $GLOBALS['cur_template']; ?>/ajax/user.php", data: "u="+u+"&e="+e, dataType: "text"}).responseText;
if(Response == 'true') {
}else{
var error ='Przepraszamy, lecz nie istenieje taki użytkownik w naszym serwisie';
$('#bmd_nfo').append(error);
errors = 1;
}
}else{
var error = 'Wszystkie pola są wymagane'
$('#bmd_nfo').append(error);
errors = 1;
}
if(errors>0) {
return false;
}else{
return true;
}
}
mam sobie formularz:
<form action="index.php" method="post" id="lostPassForm" style="" onsubmit="vaildUser()">
<div class="componentheading">Nie pamiętam hasła
</div>
<div id="bmd_nfo">To nie problem. Podaj swój login i adres email, a następnie naciśnij przycisk "Przyślij hasło".
<br>Otrzymasz nowe hasło, które umożliwi Ci zalogowanie się w serwisie.
<br><br></div>
<table class="contentpane" border="0" cellpadding="0" cellspacing="0" width="100%">
<td>Nazwa użytkownika:
</td> <td><input name="checkusername" class="inputbox" size="40" maxlength="25" id="bmd_cun" type="text"></td> <td><input name="confirmEmail" class="inputbox" size="40" id="bmd_cem" type="text"></td> <td colspan="2" align="center"><input class="" value="Przyślij hasło" type="submit"></td> <input name="option" value="com_registration" type="hidden"> <input name="task" value="sendNewPass" type="hidden"> <input name="je32ebc9e50732246b12441df135a74e9" value="1" type="hidden">
Sorry że kod nie jest xhtml ale to stara joomla to generuje...
No i teraz jak robie wyślij to wg firebuga wchodzi w warunek if(errors>0) i zwraca false, a pomimo tego głupi formularz się wysyła.
Błagam o pomoc bo więm że błąd jest pewnie trywialny ale już 3 h oglądam ten kod i zapewnę go już nie widzę. A klient tylko dzwoni i wymienia słowa na K (IMG:
http://forum.php.pl/style_emoticons/default/smile.gif)
Z góry dzięki i pozdro.