jeudi 25 juin 2015

Jsp : Checkbox and Hiperlink dependency

I am using JSP and Struts2.

If the user selects the checkbox without clicking on hyperlink, user should get the error msg above the checkbox line.

I think on click of hyperlink I should call one function which sets the global var to true. onclick of checkbox, I should call a function which checks the var val and if this is false error should display.

In case of checkbox uncheck error should not be visible. Its like a terms and we want that user should click on hyperlink to see terms.

Please help.

<tr>
<td colspan="2" style="padding-left: 3%;">
<s:text name="Text1" />
<a href='<s:property value='#session.url'/>' class="l1" target="_blank"><s:text name="Text2" /></a>
<s:text name="Text3" />
</td>

<tr>
<td colspan="2" style="padding-left: 3%;"><s:checkbox name="isT" id="isT" label="isT" value="%{isT}" tabindex="12" />&nbsp;&nbsp; <s:text name="isTer" />
</td>

Aucun commentaire:

Enregistrer un commentaire