2014-12-03 2 views
-1

Я пытаюсь создать код AJAX с PHP.jQuery Форматирование AJAX - форматирование HTML-форматирования автоматически изменено после загрузки

Главный PHP-код: here.

И поддерживающий PHP-код (который загружается с AJAX каждый раз) равен here.

AJAX загружен совершенно.

Но он не загружен совершенно.

Что AJAX должен сделать, это дает такой код каждый раз -

   <tr> 
        <form action="update" method="post"> 
         <th nowrap=""><?php echo '<a href="profile/'.$row_list['vanity_url'].'" target="_new">'.substr($row_list['name'],0,15).'</a>'; ?></th> 
         <th ><input type="text" readonly value='<?php echo $row_list['vanity_url']; ?>' class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="old"></th> 
         <th nowrap=""><br/></th> 
         <th ><input type="text" class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="new" placeholder="*New URL" required autocomplete="off" ></th> 
         <th nowrap=""><br/></th> 
         <th nowrap=""><button type="submit" class="btn btn-primary">Update</button></th> 
        </form> 
       </tr> 

Но это не дает этого. Он дает

    <tr> 
        <form action="update" method="post"></form> 
         <th nowrap=""><?php echo '<a href="profile/'.$row_list['vanity_url'].'" target="_new">'.substr($row_list['name'],0,15).'</a>'; ?></th> 
         <th ><input type="text" readonly value='<?php echo $row_list['vanity_url']; ?>' class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="old"></th> 
         <th nowrap=""><br/></th> 
         <th ><input type="text" class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="new" placeholder="*New URL" required autocomplete="off" ></th> 
         <th nowrap=""><br/></th> 
         <th nowrap=""><button type="submit" class="btn btn-primary">Update</button></th> 
       </tr> 

Таким образом, форма закрыта, поэтому ее использование невозможно.

Может ли кто-нибудь помочь мне, пожалуйста?

Заранее благодарим за помощь.

+0

Ваш возвращенный HTML недопустим. проверить этот ответ http://stackoverflow.com/questions/1249688/html-is-it-possible-to-have-a-form-tag-in-each-table-row-in-a-xhtml-valid -путь –

ответ

0

Попробуйте использовать этот код

while($row_list=mysqli_fetch_array($query)) 
     { ?> 
      <tr> 
       <td> 
        <form action="update" method="post"> 
         <table style="width:100%"> 
          <tr> 
           <td nowrap=""> <?php echo '<a href="profile/'.$row_list['vanity_url'].'" target="_new">'.substr($row_list['name'],0,15).'</a>'; ?> </td> 
           <td>   <input type="text" readonly value='<?php echo $row_list['vanity_url']; ?>' class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="old"> </td> 
           <td>   <input type="text" class="login-text name right10 form-control" style="width: 600px" id="registerCompany" name="new" placeholder="*New URL" required autocomplete="off" > </td>  
           <td nowrap=""> <button type="submit" class="btn btn-primary">Update</button>  </td> 
          </tr> 
         </table> 
        </form> 
       </td> 
      </tr> 
<?php } 

Think она будет решена.

Смежные вопросы