由网址填写表格

时间:2013-06-04 02:39:53

标签: html string forms url fill

我需要在URL中使用查询字符串来填写表单,但问题是通过将基本形状(page.php?title = value& title2 = value)设置为不完整。通过从MYSQL数据库读取值来预填充表单。这是代码:

<form action="change.php" method="post">
Titulo:<br />
<input name="titulo" type="text" value="'.$row_show['titulo'].'"size="120" maxlenght="50"/><br /><br />
Banner URL:<br />
<input name="banner" type="text" value="'.$row_show['banner'].'"size="120"/><br /><br />
Link:<br />
<input name="link" type="text" value="'.$row_show['link'].'"size="120"/><br /><br />
Descripcion:<br />
<input name="descripcion" type="text" value="'.$row_show['descripcion'].'"size="120" maxlenght="70"/><br /><br />
Disponibilidad:<br />
<input name="disponibilidad" type="text" value="'.$row_show['disponibilidad'].'"size="120"/><br /><br />
<input type="hidden" name="id" value="'.$row_show['id'].'" />
<br />
<input type="submit" class="proofbutton" name="modificar" value="MODIFICAR ADSPACE" />
</form>

我需要在此表单中插入其他值,但我不需要删除默认值。

e.g。 change.php TITULO =尼克&安培; descripcion =测试%20fill

抱歉我的英语不好。感谢

2 个答案:

答案 0 :(得分:0)

我不确定为什么浏览器不会转发所有输入数据,但尝试使用javascript提交表单,看看是否有效。类似的东西:

<a href="javascript:this.parentNode.submit()">Submit</a>

您可能需要考虑确定是否在接收端指定了它们,而不是将默认值添加到接收端,如果没有,则使用默认值。

答案 1 :(得分:0)

一种简单的方法...将任何默认值存储在page.php上各自唯一命名的隐藏字段中。然后,当您发布到change.php时,您可以编写确定应保存哪些值的逻辑。