1

This is my form1

<form name="form1" method="post" action="#">
<input id="date_input_2" type="text" name="emp_item_hawala_date" />
<input type="submit" value="search">
</form>

this is my form2 which I want its text input to just get automatic from form1 when ever I enter text to input (emp_item_hawala_date) from form1 the same input of form2 should take it's text too.

<form name="form2" method="post" action="#">
<input id="date_input_1" type="text" name="emp_item_hawala_date" />
<input type="submit" value="print">
</form>

Here on my form1 I want to put by selectively or input direct it should apear on my second form input by automatic.

is it possible?

regards

4

3 回答 3

0

你可以试试这个jquery代码

<script>
$("document").ready(function(){

$("#date_input_1").keyup(function(){
$("#date_input_2").val($(this).val());
});
$("#date_input_2").keyup(function(){
$("#date_input_1").val($(this).val());
});


});


</script>
于 2013-10-07T10:44:12.930 回答
0

在 form1 中,执行以下操作:

<input id="date_input_2" type="text" name="emp_item_hawala_date" onblur=(document.getElementById('date_input_1').value=this.value) />
于 2013-10-07T10:40:52.810 回答
0

您可以简单地使用按键功能。

你在其中添加日期选择器..

http://jsfiddle.net/DfHSS/

   $("#date_input_1").keyup(function(){
       $("#date_input_2").val($(this).val());
    });
于 2013-10-07T10:41:30.907 回答