• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts1 - multibox uncheck action

 
Chandran Madesh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In one of my jsp page, i am iterating some values with Multibox. As part of requirement, i need to populate the selected multibox value in another text box. Also the value needs to be removed from the text box when the corresponding multibox is unchecked.

I was able to make the first part(populate the value when a multibox is selected) working with the help of onclick JS function. But i couldn't make the second part work properly. I tried using hidden variable, JS array, but i could not get the value when a multibox is unchecked.

I want to know is there a way to get the value when a multi box unchecked.

Any suggestions / input would be appreciated.

Thanks in Advance,
Chandran
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it resolved? If not, just a thought, to check or uncheck the multibox there is "onclick" action. why is it not possible to refresh the destination/selected list on every onclick action.
 
Chandran Madesh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shankar,

Thanks for your post.

Already i tried this onclick action. As far as i know, the one option to get the selected value is iterate all the multibox and check is it selected, if <Multibox>.checked==true read the value. The below is the js function i used to read the Multibox value. This is working fine when the mutibox is selected. But when the Multi box is delected i couldn't get the value as the current deselected box fail for the .checked==true condition.


Do you see any other option.

>
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Struts is it 1.?

Also could you just post how you are calling js method in JSP, it would be helpful..
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try selected instead on checked.. Anyways I shall try in my local and let you know... I use Str.1.2
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I just tried it in S1.2.. this should work, try it once

In JSP something like this



in js, I just got stuck/stumped with the options though. Here the tutorial is good (best one for you and you need not search anymore) and i just used it...


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic