Form input field issues using ng-model and ng-init
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 07:44 PM
Hi,
I created a modal form on one of my Catalog Item forms. The user would click a button on the catalog item form to open up the modal form. I am passing the value from a field on the Catalog item to the modal form. In which I would take that value and look up the user in the Server script to retrieve their manager, email, and job title. I got everything to work, but the issue that I am running into is that I populated on the modal form are no longer editable.
I want the user to be able to make changes to the field, if needed. Here is my html, server script, and client controller.
I tried setting the ng-init to c.reqName=data.name without the brackets, but it didn't work. How can I make these editable?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 11:29 PM
have you tried removing the ng-init, and just using ng-model?
Like so:
in HTML: ng-model="c.data.your_var"
and in the server script:
data.your_var = "something";
just a random thought really, have not tested this so not sure if it will help here, but this is usually how I bind values to HTML.
Also, are those fields read-only, or is it that whatever you do, your values get overwritten with defaults? If it is the latter, maybe there's a problem with the way you're watching/updating the server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 07:45 AM
Hi,
No I have not tried that. Because after they have submitted, then I need some of the fields to pass back into the form.
Would you know how can I set this up?
These are the steps.
1. Catalog Item form (they answer the reference field question who is this request for)
2. User click button to fill out modal form
3. The sys_id from the reference field is sent up to modal form.
4. Server script retrieves the name, email, manager, and job title of the sys_id.
5. The values of the server script is passed to the html fields on the modal form.
6. The users can still edit those fields.
7. Once the form is complete, the user will hit save
8. The information from the modal form is passed back into the catalog item form.
I personally wanted to just have all those fields and the users to just fill out the catalog item form, but this is what they wanted.
I know this is possible but the non-editable fields are what's causing an issue.