File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes html:hidden problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:hidden problem" Watch "html:hidden problem" New topic

html:hidden problem

sreeram kosaraju

Joined: Nov 01, 2012
Posts: 2
Hi All,

I have a problem with the html:hidden tag.

I am trying to assign the value of the hidden radioSelected property with a value derived from another property keyId.
I am not able to do so.

Below is my code.

<logic:iterate id="bankKeyTpTable" name="clientAdminForm" property="bankKeyTPAssocList" type="BankKeyTPAssoc">
<bean:define id="key" name="bankKeyTpTable" property="keyId"/>
<html:multibox name="clientAdminForm" property="rpgpKeyIdsForAction">
<bean:write name="bankKeyTpTable" property="keyId"/>
<td align="left" class="<%= background %>"><bean:write name="bankKeyTpTable" property="keyId" /></td>
<html:radio name="bankKeyTpTable" property="signingAndDecrypting" value="true" >
<html:hidden property="radioSelected" value="<%= %>" />

Can someone please help me in achieving this.
The value in of the hidden property should be set with the value from the keyId property.

Thanks in advance.

jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi Sreeram,

you need to assign the value of selected radio button to hidden filed , you can achieve this with the javascrit.

Use onclick event of radio button and assign the value to hidden field.

sreeram kosaraju

Joined: Nov 01, 2012
Posts: 2
Hi Jatan,

Thanks for your reply.

I tried what you suggested. But I was not able to pass the bean property to the javascript function.
Can you please give me a code snippet.

Below is what i tried:

But I am getting a null here.
Please advice.
I agree. Here's the link:
subject: html:hidden problem
It's not a secret anymore!