如何重新填充表单?

时间:2011-12-06 06:17:51

标签: php forms wordpress

我有一个用户表单,可以在Wordpress php中创建一个下拉菜单。表单在提交后清除。如果单击编辑铅笔图标以便可以编辑原始信息,如何重新填充表单?实际上,因为表单被清除,它会启动另一个菜单。 有一个类别和多个名称。

谢谢......如果您需要信息,我会发布。我尝试着... -A

我遇到了问题......正如我所提到的,有一个“编辑按钮”可以创建一个人设计的愚蠢编辑表单。我想重新填写用户填写的原始表单。我快到了。信息填写在框中,但它们随机覆盖下拉菜单。它不是在原始形式内部。 “pp-website-edit”是“编辑按钮”的名称。

  <div class="pp-website-edit">
                <form id="cat-edit-<?php echo $x; ?>" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
                <input type="hidden" name="edit-category" value="<?php echo $indicat; ?>">
                <INPUT TYPE="image" SRC="<?php bloginfo('url'); ?>/wp-content/themes/nebula/neb-style/images/arrow_045_small.png" HEIGHT="14" WIDTH="14" BORDER="0" ALT="Submit Form">
                </form>
            </div>



              <div class="pp-website-edit">
                                <form id="wat-edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
                                <input type="hidden" name="edit-website" value="1">
                                <input type="hidden" name="ed-w-cat" value="<?php echo $indicat; ?>">
                                <input type="hidden" name="ed-w-label" value="<?php echo $finalresult[$y][name]; ?>">
                                <input type="hidden" name="ed-w-url" value="<?php echo $finalresult[$y][url]; ?>">
                                <INPUT TYPE="image" SRC="<?php bloginfo('url'); ?>/wp-content/themes/nebula/neb-style/images/arrow_045_small.png" HEIGHT="14" WIDTH="14" BORDER="0" ALT="Submit Form">
                                </form>

=============================================== =============================

                                                              网站分类                 网站标题                 网站网址                                                                                               

1 个答案:

答案 0 :(得分:0)

保持其值的表单使用某种形式,cookie,或查询数据库中值的组合。

无论哪种方式,您都需要在<input>标记内回显我们的值。