05-05-2007, 09:58
|
|
|
|
חבר מתאריך: 22.02.07
הודעות: 170
|
|
העברת נתונים מטופס לפונקציית JAVA SCRIPT
מסיבה כלשהי זה לא עובד.
הפונקציה:
קוד:
function check()
{
var tavim,tavim_len,str_delete
tavim=document.shem.chartav.value
tavim_len=tavim.length;
str_delete="dessessy"
if (tavim=="")
{
alert ("Enter the letters as they are shown" + '\n' + "in the image above")
return (false)
}
if (tavim_len<>8)
{
alert ("charcters are incorrect")
return (false)
}
for(i=0;i<8;i++)
{
if ((tavim.charAt(i))!=(str_delete.charAt(i))
{
alert ("Characters are incorrect")
return (false)
}
}
return (true)
}
הקוד HTML:
קוד:
<table>
<form name="shem" action="delete.asp" method="post" onsubmit="return check()">
<tr>
<td align="center"><font size="2">
Type the characters you see in the picture below,</br> to delete your account</td>
</tr>
<td align="center">
<img src="../pics/1.jpg">
</td>
</tr>
<tr>
<td align="center">
<input type="password" name="chartav"></td></tr>
<tr>
<td align="center">
<input type="submit" value="Delete my Account"></td></tr>
</table>
</form>
אשמח לקבל תגובות בהקדם האפשרי.
תודה וחג שמח!
|