开发者

How do I select form inputs based on user actions and choices?

Firstly, it was hard to include the question inside the title, so don't bash me.

I have a web framework created by someone and I need to learn to use it.

Let's say I have this HTML form:

<form action="servletX" method="get">
    <input name="action" value="search" type="submit">
</form>

When the search button is submitted, inside of the servlet, is extracted, based on the word "action" (this is forced by the structure of the framework), what kind of action needs to be made. One more thing: the action, in this case, "search" is in fact the key for a proprieties file which is read in one of the classes.

My question is: How can I implement a search feature, using this framework.

I want to have a field where I enter the data based on which the search is made and 2 submitted buttons (2 options)

Something like this:

<开发者_如何学Cform action="servletX" method="get">
    <p>Search
        <input name="action" type="text">
        <input name="action" value="Option1" type="submit">
        <input name="action" value="Option2" type="submit">
    </p>
</form>


Use buttons or radio buttons instead of generic inputs. They are intended for mutually-exclusive options of the sort required here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜