[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: нужна помощь
dilfin
ребята пожалуйста посмотрите на колонку social security тама есть ошибка но никак не могу найти и понять ошибку
<!DOCTYPE html>
<html>
<head>
<body>
<h2>
Student Information</h2>
<form
action ="">
<p>
<label>
<input
type = "text" id = "StdName"/>
Name
</label>
<br /><br />

<label>
<input
type="text" id = "address"/>
Address
</label>
<br/><br>

<label>
<input
type="text" id="phone"/>
phone number(ddd-ddd-dddd)
</label>
<br/><br/>

<label>
<input
type="text" id="social security"/>
social security(ddd-ddd-dddd)
</label>
<br/><br/>

<label>
<input
type="text" id="birth date"/>
birth date(dd-dd-dd)
</label>
<br/><br/>


<label>
<input
type="text" id="Email"/>
email(@)
</label>
<br/><br/>

<input
type ="reset" id= "reset"/>
<input
type="submit" id="Submit"/>
</p>
</form>
</body>
</html>

<script>
function
chkPhone(){
var x = document.getElementById("phone").value;

if (x==null || x=="")
{
alert("Phone number cannot be left blank");
return false;
}

if(isNaN(x)|| x.indexOf(" ")!=-1)
{
alert("Invalid phone number")
return false;
}

if (x.length > 10)
{
alert("Only 9 characters");
return false;

}

}


function chkSocial(){
var social = document.getElementById("social security").value;

if (social==null || social=="")
{
alert("social security cannot be left blank");
return false;
}

if(isNaN(social)|| social.indexOf(" ")!=-1)
{
alert("Invalid Social Security ");
return false;
}
if (social.length > 9)
{
alert("Enter only 9 characters for Social Security");
return false;
}

}


document.getElementById("phone").onchange = chkPhone;
document.getElemenyById("social security").onchange = chkSocial;
</script>
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.