Home >Backend Development >PHP Tutorial > form表单中action,该如何解决

form表单中action,该如何解决

WBOY
WBOYOriginal
2016-06-13 12:56:49969browse

form表单中action

<br />
<form action='a.php?act=XXX' method='post'><br />
<input type='text' name='action' value=''/><br />
<input type='submit' name='sub' value='提交'/><br />
</form><br />

此段代码form表单中的action属性中XXX是获取到的框中的值,
请问我该怎么获取到,谢谢


------解决方案--------------------
单一的PHP 是不能满足你的需求的 

<br />
<script type="text/javascript"><br />
function fun_action_src(){<br />
	var vals = document.getElementById('aid').value;<br />
	document.getElementById('form1').action = "a.php?act="+vals;<br />
	document.getElementById('form1').submit();<br />
	//alert(vals);<br />
	<br />
	}<br />
</script><br />
<form id="form1" action='' method='post'><br />
<input id="aid" type='text' name='action' value=''/><br />
<input onclick="fun_action_src()" type='button' name='sub' value='提交'/><br />
</form><br />
<br />
Statement:
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