Is there any way to make form url parameter submit by value of label?
I mean, I want to do simple sear开发者_StackOverflow中文版ch form like this:
<form:form action="usersearch.do?searchName=....">
<input type="text" id="search" name="search"> <input type="submit" value="Search">
</form:form>
How to set url parameter "searchName" by value that was put in my form, like: usersearch.do?searchName=JohnSmith
If you change your form method to "GET" then the field names will be submitted on the query string. For example:
<form:form action="usersearch.do" method="GET">
<input type="text" id="search" name="searchName"/>
<input type="submit" value="Search"/>
</form:form>
Will do result in a GET on a URL that looks like:
.../usersearch.do?searchName={formValue} e.g. JohnSmith
精彩评论