I have a table that contains form elements that I need to replace if a use clicks a link. The idea is that the fields are automatically filled in for them if they click the button and the fields then become just html p elements because I don’t want the user to be able to edit these fields once auto filled in. There are however other fields which will need to be still filled in.
So what I need is when user clicks link, 4 trs are replaced with 4 p tags with text inside them. This doesn’t seem to be working on the trs. So I am now trying it on the td that contains the input field:
$('#use_patient_field').click(function(e){
e.preventDefault();
$('#patientForm_f_name').html('blah');
return false;
});
I have also tried overwriting the input fields and nothing happens with that either. I need the table to still exist but replace the input and select tags.
I have found what I was looking for. You can set an input field to read only, which meant I then didn’t have to replace the form fields with p elements.
This is the code in case any future perosn needs it: