-3

我有一个像这样的简单表格:

<form action="emplist.html" method="post" rel="external">
Please enter one or several search items. Can be partial.
<label for="empid" class="ui-hidden-accessible">Employee ID:</label>
<input type="text" name="empid" id="s_empid" value="" placeholder="Employee ID"/>
<label for="lname" class="ui-hidden-accessible">Last Name:</label>
<input type="text" name="lname" id="s_lname" value="" placeholder="Last Name"/>
<label for="fname" class="ui-hidden-accessible">First Name:</label>
<input type="text" name="fname" id="s_fname" value="" placeholder="First Name"/>
<label for="department" class="ui-hidden-accessible">Department:</label>
<input type="text" name="department" id="s_department" value="" placeholder="Department"/>
<a href="emplist.html?eid=%s_empid&lnam=%s_lname&fnam=%s_fname&dep=%s_department" data-role="button" data-theme="b" data-icon="search" rel="external">Submit Search </a>
<input type="reset" value="Reset Form" data-theme="e" data-icon="delete"/>

当然不能按原样工作,但总体思路是使用我正在捕获的表单参数构建 href URL。

非常感谢您的帮助。

4

1 回答 1

2

这就是GET 方法的用途。在您的表单中使用它:

<form action="emplist.html" method="get" rel="external">
    <!-- all your fields should go here... -->
    <input type="submit" value="Submit Search" />
</form>
于 2013-01-25T15:13:29.883 回答