You could use
jQuery[
^] to toggle the fields, if you already assigned the textboxs (which require toggling) with a class.
$('.toggle:text').attr('readonly', ( $('.toggle:text').attr('readonly') == 'readonly' ? '' : 'readonly' ) );
So now, every
<input type="text" class="toggle" name="example" />
will now toggle between readonly and editable.
Notice that it will only change input fields of type 'text', with a class of 'toggle'.