Using javascript to set Struts select list headerKey and headerValue -


i have struts select list use javascript set selected option default headerkey , headervalue specified when creating item. unable option set. under select list:

struts select list

<s:select id="relationshiptypeid" name="relationshiptypelist" headerkey= "0" headervalue="select relationship type" list="relationshiptypelist" listkey="id" listvalue="relationshipname"/> 

javascript

this not work sets display item 0 default headerkey , headervalue.

  document.getelementbyid('relationshiptypeid').value = 0; 

this worked me after posted question

document.getelementbyid('relationshiptypeid').setattribute('value',0); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -