?—?°???°?‡?°:
?•???‚?? ?„?


°,

µ?

?‚?

?‹?µ

??»??

??‚?


?

°?



µ?

?‚??

°

??°?

?»?


??‚??



°.
?”?


??‚?

?‡?‚??

°??

°?



µ?

?‚?? 5

??»?µ??: ?¤?

, ?‚?µ?»?µ?„?

,

??±???»?

?‹?? ?‚?µ?»?µ?„?

, ?µ???°???» ??

??»?µ




?° (

°?? ?·???µ?
http://tonstudio.ru/form_feedback.php)
1.

??·???°?µ??

°?

?? "js"
2.

??·???°?µ?? ??

µ?? ?„?°???» "checkform.js"
3.


?µ???‚?

‚???‚ ?„?°???» ??

°?

‚???°?

?‡?

?? ?„?



. (

µ?»?°?µ??

‚??

µ???µ?? ?‚?µ?

?? </head>, ?…???‚??,

?

??µ?

,

°?±???‚?°?µ?‚

??‚?°?

?° ?? ?»???±?

µ???‚?µ



??µ???‚?°,

»?°?


µ ?‡?‚???±?‹

µ???µ?? ?„?



):
?’???‚ ?‚?°??

‹ ?µ?



»???‡?

??



??µ???‚??
<script language=JavaScript charset="windows-1251" src="/js/checkform.js"></script>


µ?‡?°?
?µ! ??






?? ??


?? ??


?±?°?‚?

??,

? ??

µ?

charset="windows-1251"

°?±???‚?°?µ?‚ ??

°

°???‚?°?… ?? utf-8 ??

°

°???‚?°?… ?? windows-1251. ?“???µ ?‚?? ?? ?‡???‚?°?» ?‡?‚??

°?¶?

??°?·?°?‚?? ?‚??






, ??

??‚?


? ?±?

?µ?‚ ?·?°?


°??

°?? ?„?°???» ?? JavaScript
4. ?’ ?‚?µ???µ <form>,


?µ??
name='myform' ?? onSubmit='return check();



µ?? ?·?°?

?»???µ?


? ?‚?µ???° <form>:
<form name='myform' method="post" action="/scrypt/formmail.php" onSubmit='return check();'>
5. ?’??

??µ

??»??,

??‚?

?‹?µ

‹ ?±?

?µ??



µ?

?‚??,

??µ?»?°?µ??

??‚?°?

??

»?µ?


‰???…


?°?

:
onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'

°?


??µ?? ?? ?‚?µ?

<input>


µ??: <input type="text" name="telefon" size="35" value="" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'>
?’




‚?

?°?

?‚??

‹

??‚?°?

??


?°?

?? disabled, ?‡?‚??

°???‚

°??

??·?

?¶?


‚?? ?·?°?

?µ?‚???‚??



µ?

?? ??

‚?

?°?

?? ?„?


‹,

?



»?

?‚?µ?»?



??»?


?. ?’

°???µ??

»???‡?°?µ

‚?

??»?


µ?? ?±?

?µ?‚



µ?

?° ?·?°?

?»???µ?


??‚??

µ?



??»??. ?”?»?? ?‚?

?? ?‡?‚???±?‹



??° "

‚?

?°?

?‚??"

??»???‡???»?

,

°?

?·?°?

?»?

?‚?? ?…???‚?? ?±?‹ 3 ?·???°???°.

‚?°??,



µ?? ?„?


‹ ??


?µ???¶?°?

?? ?„?°???»?° ??

°???µ?? ?„?



(

? ?‚?°?


? ?¶?µ



†?

??

°?±???‚?°?µ?‚ ?„?


° ?·???µ?

:
http://tonstudio.ru/form_feedback.php)
?’?°???° ?„?


°: (? ?°?±???‚?°?µ?‚ ??

»???‡?°?µ

°?»???‡?

??

??°?·?°?

??

??‚?? ?? ?„?°???»??

±???°?±???‚?‡?

?? ?„?


‹)
<script language=JavaScript charset="windows-1251" src="js/checkform.js"></script>
<form name='myform' method="post" action="?’?????¤???™?›???‘? ???‘????????" onSubmit='return check();'>
?¤???? <input type="text" name="sender" size="50" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'><br>
?????±.???µ?»?µ?„???? <input type="text" name="mobile" size="50" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'><br>
???µ?»?µ?„????<input <type="text" name="telefon" size="50" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'><br>
?µ???°???»<input type="text" name='email' size="50" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'><br>
?’?°?? ???????????? <textarea name="qwest" cols="55" rows="10" onkeypress='checkreq()' onkeyup='checkreq()' onblur='checkreq()'>?’?°?? ????????????</textarea><br>
<input type="submit" name='Submit' value="???‚?????°?????‚?? >>>" class="button" disabled>

µ???µ?


?µ???¶?°?

?µ js/chekform.js
// ?????????µ?????° ?????µ???µ?????????? ?????µ???? ?? ???????±?‰?µ?????? ?? "?????»???‡?µ?????µ" ???????????? ???‚???? ???????±?‰?µ??????
function checkreq() {
path = document.myform;
tmp = (path.sender.value == "");
if (!tmp && (path.sender.value.length < 3)) tmp = true;
path.Submit.disabled = tmp;
if (tmp) return;
}
// ?????????µ?????° ?????????µ???‚???????‚?? ?·?°?????»???µ?????? ?????»?µ?? ?¤????
function check()
{
p_sender = document.myform.sender.value.toString();
if(p_sender != "") {
if(p_sender.length<1 || p_sender.length>60) {
alert ("?????°?¶???‚?µ ???°???µ ?????? (???‚ 2?… ???? 60 ???????????»????)!");
document.myform.sender.focus();
}
} else {
alert("???µ???±?…?????????? ?????µ???‚?? ?¤???? !");
document.myform.sender.focus();
}
// ?????????µ?????° ?????????µ???‚???????‚?? ?·?°?????»???µ?????? ?????»?µ?? ?????±???»?????‹?? ?‚?µ?»?µ?„????
p_mobile = document.myform.mobile.value.toString();
if(p_mobile != "") {
if(p_mobile.length<10 || p_mobile.length>30) {
alert ("?????°?¶???‚?µ ???°?? ?????±???»?????‹?? ?‚?µ?»?µ?„???? ?? ???µ?¶???????°???????????? ?„???????°?‚?µ (???‚ 10 ???? 30 ???????????»????)!");
document.myform.mobile.focus();
return false;
}
} else {
alert("???µ???±?…?????????? ?????µ???‚?? ?????±???»?????‹?? ?‚?µ?»?µ?„????!");
document.myform.mobile.focus();
return false;
}
// ?????????µ?????° ?????????µ???‚???????‚?? ?·?°?????»???µ?????? ?????»?µ?? ???µ?»?µ?„????
p_telefon = document.myform.telefon.value.toString();
if(p_telefon != "") {
if(p_telefon.length<10 || p_telefon.length>30) {
alert ("?????°?¶???‚?µ ???°?? ?‚?µ?»?µ?„???? ?? ???µ?¶???????°???????????? ?„???????°?‚?µ (???‚ 10 ???? 30 ???????????»????)!");
document.myform.telefon.focus();
return false;
}
} else {
alert("???µ???±?…?????????? ?????µ???‚?? ?‚?µ?»?µ?„????!");
document.myform.telefon.focus();
return false;
}
// ?????????µ?????° ?????????µ???‚???????‚?? ?·?°?????»???µ?????? ?????»?µ?? ?µ???°???»?°
p_email = document.myform.email.value.toString();
if (p_email != "") {
t = p_email.indexOf("@");
if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) {
alert("???µ?????????µ???‚???? ?????°?·?°?? E-mail !");
document.myform.email.focus();
return false;
}
} else {
alert("???µ???±?…?????????? ?????µ???‚?? email!");
document.myform.email.focus();
return false;
}
// ?????????µ?????° ?????????µ???‚???????‚?? ?·?°?????»???µ?????? ?????»?? ?? ????????????????
p_qwest = document.myform.qwest.value.toString();
if(p_qwest != "") {
if(p_qwest.length<3 || p_qwest.length>600) {
alert ("?????°?¶???‚?µ ???????????? ?????°?????»?????? (???‚ 3 ???? 600 ???????????»????)!");
document.myform.qwest.focus();
return false;
}
} else {
alert("???µ???±?…?????????? ?????µ???‚?? ????????????!");
document.myform.qwest.focus();
return false;
}
}
?’?


µ

??µ... ?”???»?¶?

°?±???‚?°?‚??, ?µ???»?? ?‡?‚??

µ ?‚?°??,


?°?


°???‚?µ.