表单按钮以前工作过,现在它已经不存在了

时间:2017-01-02 12:37:54

标签: php jquery html

<script>
$(document).ready(function() {
    var panels = $('.user-infos');
    var panelsButton = $('.dropdown-user');
    panels.hide();

    //Click dropdown
    panelsButton.click(function() {
        //get data-for attribute
        var dataFor = $(this).attr('data-for');
        var idFor = $(dataFor);

        //current button
        var currentButton = $(this);
        idFor.slideToggle(400, function() {
            //Completed slidetoggle
            if(idFor.is(':visible'))
            {
                currentButton.html('<i class="glyphicon glyphicon-chevron-up text-muted"></i>');
            }
            else
            {
                currentButton.html('<i class="glyphicon glyphicon-chevron-down text-muted"></i>');
            }
        })
    });


    $('[data-toggle="tooltip"]').tooltip();

    $('button').click(function(e) {
        e.preventDefault();
    });
});
</script>
<script>
function showMe(){
       document.querySelector('#change').style.display = '';
            document.querySelector('#keep').style.display = 'none'
       document.querySelector('#change1').style.display = '';
            document.querySelector('#keep1').style.display = 'none'
       document.querySelector('#change2').style.display = '';
            document.querySelector('#keep2').style.display = 'none'
       document.querySelector('#change3').style.display = '';
            document.querySelector('#keep3').style.display = 'none'
       document.querySelector('#change4').style.display = '';
            document.querySelector('#keep4').style.display = 'none'
       document.querySelector('#change5').style.display = '';
            document.querySelector('#keep5').style.display = 'none'
}
</script>
<script type="text/javascript">
$(document).ready(function() {
    $('#wrapper').dialog({
        autoOpen: false,
        title: 'Upload an image!'
    });
    $('#opener').click(function(e) {
        e.preventDefault();
        $('#wrapper').dialog('open');
    });
});
</script>  

    </head>
    <body id="top">

        <!-- Header -->
            <header id="header">
                <div class="inner">
                <img src="logo-small.png" alt="" />
                <br></br>
                    <h1>Jasmine</h1>
                </div>
            </header>

        <!-- Main -->
            <div id="main">

                <!-- One -->
                    <section id="one">
                <div class="container">
                <a href="logout.php" id ="logout">Logout</a>
<?php 
if($_GET['a'])
{

echo '<p style= "color:red;"> Please select an appropriate image ';


}
?> 
      <div class="row">
      <div class="col-md-5  toppad  pull-left col-md-offset-3 ">

       <br>
        <br>
    <!-- <p class=" text-info">May 05,2014,03:00 pm </p>-->
      </div>   
          <div class="panel panel-info">
            <div class="panel-heading">
              <h3 class="panel-title"><?php echo $firstname . " ". $lastname;  ?></h3>
            </div>
             <form method= "post" action= "edit.php">
            <div class="panel-body">
              <div class="row">

                <div class="col-md-3 col-lg-3 " id= "show"> <img alt="User Pic" src= <?php echo "../profilepic/" .$path; ?> class="img-circle img-responsive">
                <button class="btn btn-sm btn-info" id="opener"><i class="glyphicon glyphicon-edit"></i></button>
                 </div>
                <div class=" col-md-9 col-lg-9 "> 
                  <table class="table table-user-information">
                    <tbody>
                      <tr>
                        <td>First name:</td>
                        <td><span id= "keep"><?php echo $firstname;?></span><input id= "change" value= "<?php echo $firstname;  ?>" style= "display:none;" name="name"></td> 
                      </tr>
                      <tr>
                        <td>Last name:</td>
                        <td><span id= "keep5"><?php echo $lastname;?></span><input id= "change5" value= "<?php echo $lastname;  ?>" style= "display:none;" name="lname"></td> 
                      </tr>
                      <tr>
                        <td>Date of Birth</td>
                        <td><span id= "keep1"><?php echo $birthday; ?></span><input id= "change1" value= "<?php echo $birthday; ?>" style= "display:none;" name="bday"></td>
                      </tr>

                         <tr>
                             <tr>
                        <td>Gender</td>
                        <td><span id= "keep2"><?php echo $gender; ?></span><input id= "change2" value= "<?php echo $gender; ?>" style= "display:none;" name="gen"></td>
                      </tr>
                        <tr>
                        <td>Country</td>
                        <td><span id= "keep3">US</span><input id= "change3" value= "US" style= "display:none;" name="country"></td>
                      </tr>
                      <tr>
                        <td>Email</td>
                        <td><span id= "keep4"><a href="mailto:info@support.com"><?php echo $email; ?></a></span><input id= "change4" value= "<?php echo $email; ?>" style= "display:none;" name="mail"></td>
                      </tr>

                    </tbody>
                  </table>
                </div>
              </div>
            </div>

                 <div class="panel-footer">
                        <a data-original-title="Broadcast Message" data-toggle="tooltip" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-envelope"></i></a>
                        <span class="pull-right">
                            <a href="#" data-original-title="Edit this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-warning" onclick = 'showMe()'><i class="glyphicon glyphicon-edit"></i></a>
        <button data-original-title="Save this user" data-toggle="tooltip" type="submit" class="btn btn-sm btn-success" id="edit"><i class="glyphicon glyphicon-saved"></i></button>

                        </span>
                    </div>
            </form>
          </div>
      </div>
    </div>    

 <div id="wrapper">


<form method="POST" action="getdata.php" enctype="multipart/form-data">
<input type="file" name="image">
<input id="images" type="submit" value="Upload">
</form>

</div>
                    </section>

我有这个表单,正如你所看到的那样,当我点击保存/提交按钮时,它会转到edit.php,它曾经工作过,现在它已经不存在了,我不知道为什么,谁能告诉我我失踪了什么?当我添加了#34;上传图片&#34;的按钮时,它停止了工作,但我检查了所有错误,并且没有关于表单的任何内容,他们不会发生冲突,任何人都可以看到问题所在,我坚持下去。

0 个答案:

没有答案