views:

311

answers:

1

I have a table which has two text boxes and a image beside it to click and open a popup. In read-only mode based on condition I am able to make text boxes read-only but images are not becoming read-only.One solution I had is the anchor tag associated with image calls for JavaScript where I can check for a dummy click when it is in read-only mode. The problem here is the function is common and effects everywhere. So is there a way to make the entire table read-only so that no extra workaround needs to done.

Edited for code

<table>
<tr>     
 <td class="lightbg" colspan='4'>&nbsp;
Expires:<input type="TEXT"  value="" id="element1" name="expireDate" size="10" maxlength="20" class=""   onChange="javascript:validateDateEntry('element1',true);;">
Period:<input type="TEXT"  value="" id="element2" name="refershDate" size="10" maxlength="20" class=""   onChange="javascript:validateDateEntry('element2',true);;">
&nbsp; <a href="javascript:doCalendar('element1');">
 <img src="/PWM/images/images_2006/calendarbtn.gif" border="0" alt="Click to select date from calendar" align="absmiddle">
      </a>
    </td>
</tr>  
<tr> 
 <td  colspan='4'><b>*</b>Times are in the WFM Server's Time Zone.</td></tr>
</table>

Thanks

A: 

An img is always readonly in html.

If you want to prevent the link from being clicked, you can do that in javascript.

jQuery example:

$('table a').click(function(event){
    event.preventDefault();
});
jeroen