I want to set the readonly attribute to true...after clicking on the edit-href(button)....i have set the id for text field as "emp " in the form itself.....i had tried in the below manner...but it is not working.....
<script type="text/javascript">
$("#edito").click(function(){
$("#emp").setAttribute("readonly", true);
});
</script>
<td>{{ (loop.index)+((page.current-1)*page.limit) }}</td>
<td>{{ employees.emplc.name|striptags|escape_css|escape_js|escape_attr }}</td>
<td>{{ employees.date_of_joining|striptags|escape_css|escape_js|escape_attr }}</td>
<td>{{ employees.u_group.name|striptags|escape_css|escape_js|escape_attr }}</td>
<td>{{ employees.u_group.role_id|striptags|escape_css|escape_js|escape_attr }}</td>
<td width="7%" >
{{ link_to("employee/edit_emp_data/" ~employees.user_group,Edit', "class": "btn ", "id":"edito") }}
</td>