jquery question

Posted by OM The Eternity on Stack Overflow See other posts from Stack Overflow or by OM The Eternity
Published on 2010-06-08T05:58:10Z Indexed on 2010/06/08 6:02 UTC
Read the original article Hit count: 226

Filed under:
|

I am using the Jquery library to copy the text enter in one textfield to another textfield using a check box when clicked.. which is as follows

<html>
<head>
    <script src="js/jquery.js" ></script>
</head>
<body>
    <form>
        <input type="text" name="startdate" id="startdate" value=""/>
        <input type="text" name="enddate" id="enddate" value=""/>
        <input type="checkbox" name="checker" id="checker" />
    </form>
    <script>
    $(document).ready(function(){
            $("input#checker").bind("click",function(o){
                if($("input#checker:checked").length){
                    $("#enddate").val($("#startdate").val());
                }else{
                    $("#enddate").val("");
                }
            });
        }
    );
    </script>
</body>
</html>

now here i want the check box to be selected by default, so that the data entered in start date get copied automatically as check box is checked by default... so what event should be called here in jquery script?

please help me in resolving this issue...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about javascript-events