Href链接不与锚标记内的data-revel-modal一起使用

时间:2017-09-21 10:37:14

标签: javascript php jquery html bootstrap-modal

在php中href的锚标签不能与onclick事件一起工作,因为onclick工作正常

<script type="text/javascript">
    function setData(user_num,user_name,user_query,subject,user_email,user_phone,status,status_change_date,query_date)
    { 
        $("#user_num").val(user_num);
        $("#user_name").val(user_name);
        $("#user_query").val(user_query);
        $("#subject").val(subject);
        $("#user_email").val(user_email);
        $("#user_phone").val(user_phone);
        $("#status").val(status);
        $("#query_date").val(query_date);
        $("#status_change_date").val(status_change_date);
        var date = query_date.split('-');
        var mon = parseInt(date[1]) - 1;
        //alert(mon);
        $("#dob_Month_ID").val(mon).change();
        $("#dob_Day_ID").val(date[2]).change();
        $("#dob_Year_ID").val(date[0]).keyup();
    }
</script>

我已获取所有值并将其添加到$ data并将其作为参数传输到javascript函数

$query = "select user_num,user_name,user_query,subject,user_email,user_phone,status,query_date,status_change_date from userqueries";
            $result = mysql_query($query,$con);

            if($result && mysql_num_rows($result)>0)
            {
                while($row = mysql_fetch_array($result))
                {
                    list($user_num,$user_name,$user_query,$subject,$user_email,$user_phone,$status,$query_date,$status_change_date ) = $row;
                    $data ="'$user_num','$user_name','$user_query','$subject','$user_email','$user_phone','$status','$status_change_date','$query_date'";
                    echo '<tr>';
                    echo '<td>' . $row["user_num"] . '</td>';
                    echo '<td>' . $row["user_name"] . '</td>';
                    echo '<td>' . $row["user_email"] . '</td>';
                    echo '<td>' . $row["user_phone"] . '</td>';
                    echo '<td>' . $row["subject"] . '</td>';
                    echo '<td>' . $row["user_query"] . '</td>';                 
                    echo '<td>' . $row["status"] . '</td>';
                    echo '<td>' . date('l M d y',strtotime($row["query_date"])) . '</td>';
                    echo '<td>' . date('l M d y',strtotime($row["status_change_date"])) . '</td>';
                    //echo '<td><a href="viewtitle.php?title_id=' . $row["user_num"]. '"  data-reveal-id="myModal" onclick="setData(' . $data . '); " >Edit  Record</a></td>';                                                              
                    echo '<td><a href="viewuserqueries.php?user_num=' . $row["user_num"] . '"  data-reveal-id="myModal" onclick="setData(\'' . $data . '\'); ">Edit This Record</a></td>';                                                                          
                    echo '<td><a href="adminreply.php?user_num=' . $row["user_num"] . '">Reply user</a></td>';                                                                          



        echo '<td><a href="viewuserqueries.php?user_num=' . $row["user_num"] . '"  data-reveal-id="myModal" onclick="setData(' . $data . '); ">Edit This Record</a></td>';  

在href中我添加了相同页面的网址,当我点击编辑此记录时,我能够看到mymodal弹出屏幕,但没有在网址中获取查询字符串。

使用了这个狂欢模式 http://foundation.zurb.com/sites/docs/v/5.5.3/components/reveal.html

请帮助!!

0 个答案:

没有答案