Populating a model parameter based on a dropdown selection
Let me first describe my use case briefly.
I have a patient model. I am adding many patient to database. Then I am trying to add a study for patient.
In my study form I am using a dropdown to select a already added patient.
In my study model I have a field for patient.
The problem is, in the form I can see the dropdown for patients, I can select one of them, but upon submitting the form, I am not getting an error: Validation failed for object='study'. Error count: 1 error on browser.
I have two more field in the study form, which are text field. I am sure this two filed does not have any issue.
For my patient form, I have used text field only, and those worked absolutely fine. Here I am unable to add the selected value from the dropdown to the patient field of Study model.