|
|
|
| Есть два поля куда вводятся определенные данные
Есть один checkbox
И есть еще два поля
Все находится на одной странице и одной форме. Необходимо сделать так чтобы после ввода данных в первые 2 поля если стоит галочка в checkbox то из этих двух полей данные дублировались в другие 2 поля.
помогите. | |
|
|
|
|
|
|
|
для: nameivan
(06.05.2008 в 11:28)
| |
<table>
<tr><td><input onblur="copy()" type="text" id="field11"/></td><td><input onblur="copy()" type="text" id="field12"/></td></tr>
<tr><td><input id="chek" type="checkbox" /></td></tr>
<tr><td><input type="text" id="field21"/></td><td><input type="text" id="field22"/></td></tr>
</table>
</body>
<script>
function copy(){
var f11 = document.getElementById('field11').value;
var f12 = document.getElementById('field12').value;
var chek = document.getElementById('chek').checked;
if(f11!='' && f12!='' && chek){
document.getElementById('field21').value = f11;
document.getElementById('field22').value = f12;
}
}
</script>
|
| |
|
|
|
|
|
|
|
для: ONYX
(06.05.2008 в 11:41)
| | спасибо | |
|
|
|