我添加了javascript后,我的jquery日历弹出不再有效

时间:2013-01-03 18:35:51

标签: javascript jquery

我的jquery日历弹出不再有效,因为我添加了javascript来添加多张图片。我是javascript和jquery的新手。任何帮助将不胜感激。

我正在尝试创建一个webform,我可以选择日期然后在下面添加多张图片。我只是将图片链接输入字段作为占位符,直到我得到一个进程来处理图片并上传它们。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>newRecord</title>

    <style type="text/css">
        div.ui-datepicker{
            font-size:10px;
        }
    </style>

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />    
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>    
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>    
    <link rel="stylesheet" href="/resources/demos/style.css" />    
    <script>    $(function() {        $( "#datepicker" ).datepicker({changeMonth: true, changeYear: true}) });</script>
    <script>    $(function() {        $( "#datepicker2" ).datepicker({changeMonth: true, changeYear: true}) });</script>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>       
    <script type="text/javascript">         
        $(document).ready(function() {
            $('#btnAdd').click(function() {       
                var num     = $('.clonedInput').length;                 
                var newNum  = new Number(num + 1);              
                var newElem = $('#input' + num).clone().attr('id', 'input' + newNum);                       
                newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);                 
                $('#input' + num).after(newElem);                 
                $('#btnDel').attr('disabled','');                   
                if (newNum == 50)                  
                    $('#btnAdd').attr('disabled','disabled');
            });               
            $('#btnDel').click(function() {        
                var num = $('.clonedInput').length;                   
                $('#input' + num).remove();                
                $('#btnAdd').attr('disabled','');
                if (num-1 == 1)                     
                    $('#btnDel').attr('disabled','disabled');             
            });               
            $('#btnDel').attr('disabled','disabled');
        });    
    </script> 
</head>
<body>
    <form action="insert.php" method="post">
        ID: <input name="ID" type="text"><br>
        serial_number: <input name="serial_number" type="text"><br>
        desc: <input name="desc" type="text"><br>
        dmg: <input name="dmg" type="text"><br>
        dmg_desc: <input name="dmg_desc" type="text"><br>
        pic_link: <input name="pic_link" type="text"><br>
        creation_date:<input type="text" name="creation_date" id="datepicker" value="" /><br>
        created_by: <input name="created_by" type="text"><br>
        last_update_date:<input type="text" name="last_update_date" id="datepicker2" value="" /><br>
        last_update_by: <input name="last_update_by" type="text"><br>

        <div id="input1" style="margin-bottom:4px;"class="clonedInput">
            Picture Upload: <input type="file" name="name1" id="name1" />     
        </div>       
        <div>        
        <input type="button" id="btnAdd" value="add another picture" />         
        <input type="button" id="btnDel" value="remove picture" />     
        </div> 

        <input type="submit">
        <br><br><br>
        <a href="http://www.sweatmansc.com/displayResults.php">Go to All results of table!</a>
    </form>
</body>

1 个答案:

答案 0 :(得分:0)

删除

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">

从你的代码中,但保持

<script src="http://code.jquery.com/jquery-1.8.3.js"></script>