|
|
|
| нужно подсчитывать сколько введено символов в форму...
в Opere and mazile работает а в IE не хочет....
вот скрипт:
function leng_date(s){
b = s.length
document.getElementById('leng').innerHTML=b;
}
|
| |
|
|
|
|
|
|
|
для: Crayzers
(03.10.2008 в 18:46)
| | b = s.value.length | |
|
|
|
|
|
|
|
для: sl1p
(03.10.2008 в 19:29)
| | вот весь код сценария
<?php
session_start();
include('kcaptcha.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Form #1</title>
<script type="text/javascript" src="jquery_1.js"></script>
<script type="application/javascript">
function leng_date(s){
document.getElementById('leng').innerHTML=s.length;
}
function ShowVersion(elem_id, el, el2) {
document.getElementById('rez').innerHTML="Loading...";
$('#'+elem_id).load('check.php?id=' + el + '&id2=' + el2);
}
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="300px">
<form action="" method="post" name="posts" id="posts">
<tr>
<td align="center" colspan="2"><h1>Form #1</h1></td>
</tr>
<tr>
<td></td>
<td align="right"><div id="leng"></div></td>
</tr>
<tr>
<td colspan="2"><textarea cols="35" rows="5" name="dates" onkeyup="leng_date(document.forms.posts.elements.dates.value)"></textarea></td>
</tr>
<tr>
<td><img src="image.php?<?php echo session_name()?>=<?php echo session_id()?>"></td>
<td width="100%"><input type="text" name="koch"/></td>
</tr>
<tr>
<td><input type="button" value="Отправить" onclick="ShowVersion('rez', document.forms.posts.elements.koch.value, document.forms.posts.elements.dates.value);"/></td>
<td><div id="rez"></div></td>
</tr>
</form>
</table>
</body>
</html>
|
| |
|
|
|
|
|
|
|
для: Crayzers
(03.10.2008 в 20:49)
| | leng_date(document.forms[0].elements['dates'].value)
так не катит? | |
|
|
|
|