Alireza Fattahi
Alireza Fattahi

Reputation: 45553

Struts 2 jquery plugin id for visible input in sj:autocompleter

When creating an struts 2 jquery auto completer, the tag creates a hidden and a visible input.

If we set the id like below:

<sj:autocompleter id="sample/>

The id will be assigned to hidden input. Is there any way we can assign the id to visible input. The generated html for this input is:

<input class="s2j-combobox-input ui-autocomplete-input">

Upvotes: 1

Views: 200

Answers (1)

Roman C
Roman C

Reputation: 1

You can select a visible input element using jQuery and use attr() function on the element(s).

$(function(){
  $(".s2j-combobox-input.ui-autocomplete-input").attr("id", value);
});

Upvotes: 1

Related Questions