Javascript 单击Href将单个表单值发布到Self

Javascript 单击Href将单个表单值发布到Self,javascript,php,jquery,forms,Javascript,Php,Jquery,Forms,我有一个基本的表格。所有元素都是文本字段 末尾有一个常规的提交按钮,用于将表单发布到另一个页面 问题是我在表单中有一个文本字段,我希望能够在运行脚本后将其发布到表单并重新加载页面 示例代码: <?php if (isset("var_needed"){ ... Do all this.... }else; ?> <form id="form" action="post_to_next_page.php" > <input name="var1" type=

我有一个基本的表格。所有元素都是文本字段

末尾有一个常规的提交按钮,用于将表单发布到另一个页面

问题是我在表单中有一个文本字段,我希望能够在运行脚本后将其发布到表单并重新加载页面

示例代码:

<?php 

if (isset("var_needed"){

... Do all this....
}else;

?>

<form id="form" action="post_to_next_page.php" >
<input name="var1" type="text" id="var1"/>
<input name="var2" type="text" id="var2"/>
<input name="var3" type="text" id="var3"/>

<input name="var_needed" type="text" id="var_needed"  />
<a href="#" onclick="...?...."><img src="../image/_apply_code_button.jpg" width="132" height="28" />

<input name="var4" type="text" id="var4"/>
<input name="var5" type="text" id="var5"/>

<input type="submit" name="submit" id="submit" value="Submit" />

你在找这样的东西吗

<?php 

if (isset($_GET['somevar'])){

... Do all this....
}else;

?>

<form id="form" action="post_to_next_page.php" >
<input name="var1" type="text" id="var1"/>
<input name="var2" type="text" id="var2"/>
<input name="var3" type="text" id="var3"/>

<input name="var_needed" type="text" id="var_needed"  />
<a href="?somevar=yes"><img src="../image/_apply_code_button.jpg" width="132" height="28" />

<input name="var4" type="text" id="var4"/>
<input name="var5" type="text" id="var5"/>

<input type="submit" name="submit" id="submit" value="Submit" />

你在找这样的东西吗

<?php 

if (isset($_GET['somevar'])){

... Do all this....
}else;

?>

<form id="form" action="post_to_next_page.php" >
<input name="var1" type="text" id="var1"/>
<input name="var2" type="text" id="var2"/>
<input name="var3" type="text" id="var3"/>

<input name="var_needed" type="text" id="var_needed"  />
<a href="?somevar=yes"><img src="../image/_apply_code_button.jpg" width="132" height="28" />

<input name="var4" type="text" id="var4"/>
<input name="var5" type="text" id="var5"/>

<input type="submit" name="submit" id="submit" value="Submit" />

你说的“发布到表单”是什么意思?如果该字段中有一个值,那么您希望数据去哪里?如果我读对了,那么
var_needed
字段已经是表单的一部分了,对吗?那么数据已经在表单中了。。?或者,将数据“发布”到表单是什么意思?对不起,我无法想象你想发生什么。一点帮助…?你说的“发布到表单”是什么意思?如果该字段中有一个值,那么您希望数据去哪里?如果我读对了,那么
var_needed
字段已经是表单的一部分了,对吗?那么数据已经在表单中了。。?或者,将数据“发布”到表单是什么意思?对不起,我无法想象你想发生什么。一点帮助。。。?