查询字符串URL填写表单文本字段,即使其名称不同

时间:2016-05-06 10:18:27

标签: html forms get

这是我的表格HTML。 url中的查询字符串采用此格式。 http://myurl.com/?source=test

<form method='get' action='/some-url'>
 <input type='text' name='address'>
<button type='submit' />GO</button>

现在,当我以上述格式访问网址时,它会使用该查询字符串值填写表单文本字段&#39; test&#39;。但是,我的文字字段名称属性是&#39;地址&#39;。

我不想用文件中的值填充文本字段。有没有办法解决这个问题?

<html>
    <form id="bh-test" method="get" action="test.php">
        <input type="text" name="address" />
        <input type="submit" value="Go" />
    </form>
</html>

0 个答案:

没有答案