简体   繁体   English

表单未重新加载当前页面

[英]form is not reloading current page

I've got a state machine in "currentpage.php". 我在“ currentpage.php”中有一个状态机。 I'm trying to call the file and prep the data in the first state. 我正在尝试调用文件并在第一种状态下准备数据。 The second state I want to display information and allow changes to be made. 我想显示信息并允许进行更改的第二种状态。 And finally the last state will be to interpret the data and save it off. 最后,最后一个状态将是解释数据并将其保存。

The following code is from the second state but when "Save" is pressed the page doesn't reload. 以下代码来自第二种状态,但是当按下“保存”时,页面不会重新加载。 Why and what can I do to make it work? 为什么以及如何使它正常工作?

<form method="post" action="currentpage.php"></form>
<div id="content">
<div id="fields">
    <?php echo '<textarea name="textarea" style="width:100%;height:100%;" >'.$_SESSION["textarea"].'</textarea>'; ?>
</div>
<div id="instructions">
    <input type="submit" id="" value="Save"></input>
</div>
</div>
</form>

Just remove 只需删除

</form>

So change 所以改变

<form method="post" action="currentpage.php"></form>

on this 在这个

<form method="post" action="currentpage.php">

You are closing the form with nothing inside it, remove the closing form tag so it looks like this: 您要关闭窗体,但其中没有任何内容,请删除close窗体标签,使其看起来像这样:

<form method="post" action="currentpage.php">
    <div id="content">
        <div id="fields">
            <?php echo '<textarea name="textarea" style="width:100%;height:100%;" >'.$_SESSION["textarea"].'</textarea>'; ?>
        </div>
        <div id="instructions">
            <input type="submit" id="" value="Save"></input>
        </div>
    </div>
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM