Sathish Kumar k k
Sathish Kumar k k

Reputation: 1842

struts2-jquery autocomplete not accepting string that which not belongs to its list

<s:form action="EmpAction">
<sj:autocompleter label="User Name (or) Login Name" name="loginName" autoComplete="true" list="userNameList"  />
<s:submit />
</s:form>

In this when I type a user name that which is from the list userNameList, and hit SUBMIT. I get the value in the Struts2 Action class. But when I type a user name that which is not in the userNameList and hit SUBMIT, I get only empty string. What do I need to do when to get this string into my Action class.

Upvotes: 1

Views: 640

Answers (1)

Aleksandr M
Aleksandr M

Reputation: 24406

By default autocompleter from struts2-jquery plugin forces selection to be one of the options. To change this you need to set forceValidOption attribute to false in <sj:autocompleter> tag.

Upvotes: 2

Related Questions