-1

现在我添加了 javascript 来添加多张图片,我的 jquery 日历弹出不再起作用。我是 javascript 和 jquery 的新手。任何帮助,将不胜感激。

我正在尝试制作一个网络表单,我可以选择日期然后在其下方附加多张图片。我只是将图片链接输入字段作为占位符,直到我得到一个处理照片并上传它们的过程。

<!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>

4

1 回答 1

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>
于 2013-01-03T18:40:46.850 回答