Caute,
mam problem s overovanim vlozenych udajov do <form>. Tento skript sice bezne pouzivam (aj si ho rozne modifikujem) a nikdy mi nerobil ziadny problem, no teraz...
Co to robi? V podstate nic a pritom by mal skontrolovat, ci sa do <form> vlozili udaje a ci je nove heslo a overenie noveho hesla rovnake.
HTML:
Kód:
<form method="post" name="formular1" id="formular1" action="zmena_hesla.php" onsubmit="return validate()"> <table border="0" cellpadding="0" cellspacing="0" style="width:450px;text-align:left;">
<tr>
<td>Vaše súčasné heslo: </td>
<td><input type="password" name="povodne" id="povodne" /> *</td>
</tr>
<tr style="height:15px;">
<td></td>
<td></td>
</tr>
<tr>
<td>Vaše nové heslo: </td>
<td><input type="password" name="nove" id="nove" /> *</td>
</tr>
<tr style="height:5px;">
<td></td>
<td></td>
</tr>
<tr>
<td>Overenie nového hesla: </td>
<td><input type="password" name="potvrd_nove" id="potvrd_nove" /> *</td>
</tr>
<tr style="height:25px;">
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Zmeniť" /></td>
</tr>
</table>
</form>
JavaScript:
Kód:
<script language="javascript" type="text/javascript">
<!-- Hide code from non-js browsers
function validate()
{
formObj = document.formular1;
if ((formObj.povodne.value == "")||
(formObj.nove.value == "")||
(formObj.potvrd_nove.value == ""))
{
alert("Musíte vyplniť všetky polia!");
return false;
}
else
{
if ((formObj.nove.value)==(formObj.potvrd_nove.value))
{
return true;
}
else
{
alert("Vaše nové heslo sa nezhoduje!");
return false;
}
}
}
// end hiding -->
</script>
Fakt uz neviem, kde je problem.
DIK.