9
i'm trying to add readonly to all the inputs and then on the click remove the readonly to make it works for typing. the readonly set for all inputs part works but the remove on click doesn't work please help.
my code :
<script language="javascript">
$(document).ready(function()
{
$('#secureFields :input').attr('readonly', true);
$('.readonly').click(
function()
{
if ($('.readonly').attr("readonly") == true)
{
$('.readonly').val('');
$('.readonly').removeAttr("readonly");
}
});
});
</script>
html is like this :
<table class='table' id='secureFields' >
<tr>
<td width=200>First Name:</td>
<td><input readonly='readonly' type='text' name='firstname' size=30 class='required'/></td>
</tr>
<tr>