无法在PHP中上传带警报的文件

时间:2015-02-06 05:38:02

标签: javascript php

我在php上传文件已经完成但是当我尝试使用警报时,它无法正常工作..这是我的代码它基本上是javascript问题。没有警报它正在工作

<form  action="<?php echo base_url('/to_upload'); ?>"method="POST" id="target" name="target" enctype="multipart/form-data">

<input type="file" name="image" >                                       
<input style="margin-top:10px;" class="btn btn-primary" id= "Upload" type="button" name="submit" onclick ="active4567()" value="Re-Deliver">    

</form>     

function active4567() {

    $.SmartMessageBox({
        title: "Delivery",
        content: "You are uploading and deliver delivery to the client",
        buttons: '[No][Yes]',

    }, function(ButtonPressed) {
        if (ButtonPressed === "Yes") {
            $.smallBox({
            title: "Virtual Office Close",
            content: "<i class='fa fa-clock-o'></i> <i>You have successfully deliver the delivery.</i>",
            color: "#659265",
            iconSmall: "fa fa-check fa-2x fadeInRight animated",
            timeout: 40000
            });
            $('#target').submit();
        }
        if (ButtonPressed === "No") {
            $.smallBox({
            title: "Set Availibility",
            content: "<i class='fa fa-clock-o'></i> <i>You have not close the virtual office.</i>",
            color: "#C46A69",
            iconSmall: "fa fa-times fa-2x fadeInRight animated",
            timeout: 4000
            });
            return false;
        }
    });

}

1 个答案:

答案 0 :(得分:0)

如果没有把<script> </script>放在你的函数周围,因为这也可能是问题所在。希望有所帮助。