php- js在不跳转的情况下向一个页面传递参数

WBOY
Release: 2016-06-02 11:32:24
Original
1269 people have browsed it

php传递参数jsp

需求是把textarea传递到savexml.php进行数据保存,但同时我希望页面还留着当前页面。
代码如下:

<code> <form name="form1" id="form1" method="post" action="newtest.php">            <input type="hidden" name="text1" value="<?php echo $text1;?>" size="30"><br>            <textarea name="textarea1" rows="10" cols="150"><?php echo $text1;?></textarea><br>            <input type="button" name="finish" value="完成拆分" onclick="save()">        </form> function save(){               //省略的代码是获得textarea的值                var formdeal= document.getElementById("form1");                 formdeal.action="savexml.php?parms="+str;               formdeal.target="_self";                formdeal.submit();}后台接收如下:<?php $str1=$_REQUEST['parms'];?></code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template