0
<s:select name="searchCriteria"
            headerValue="Select Criteria"
            list="#{'userName':'User Name','email':'Email','status':'Status','firmName':'Firm Name','firstName':'First Name',
            'middleName':'Middle Name','lastName':'Last Name'}"
              ></s:select>

<s:textfield name="searchField" size="50" />

我有一个下拉列表,允许我按搜索条件搜索用户。但是当用户选择按公司名称搜索时。我想用下拉列表替换文本框(显示可用公司)。

我怎样才能做到这一点?

4

2 回答 2

0

People didn't accept my edit over Alex_B (¬¬' I was just encoding what Alex_B said in comments) so I put this new answer:

Wrap the text box in a div and then add an event on when user makes the required selection you could do something like

$('#select_id').show();
$('#textbox_id').hide();

And the jsp:

<s:select id="first_select" ... ></s:select>

<s:select id="select_id" ...></s:select>
<s:textfield id="textbox_id" .../>
于 2012-12-03T20:30:45.057 回答
0

将文本框包装在 div 中,然后在用户进行所需选择时添加一个事件,您可以执行类似的操作

$('div').empty().html('<s: select ... ');
于 2012-12-03T14:45:57.060 回答