【问题标题】:jQuery AJAX Formatting - HTML PHP form formatting auto changed after loadedjQuery AJAX 格式 - HTML PHP 表单格式在加载后自动更改
【发布时间】:2014-12-03 19:30:47
【问题描述】:

我正在尝试使用 PHP 制作 AJAX 代码。

主要的 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>

所以,表单已关闭,因此无法使用。

有人可以帮帮我吗?

提前感谢您的帮助。

【问题讨论】:

标签: javascript php jquery mysql ajax


【解决方案1】:

尝试使用此代码

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   }

认为会解决的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-21
    • 2013-06-24
    • 2015-12-15
    • 2017-04-09
    • 2013-04-23
    • 1970-01-01
    • 2013-04-05
    相关资源
    最近更新 更多