- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2012 04:12 PM
I'd like to update the comments field for a ticket in a ui page and am having trouble figuring out how to pass the value from a textarea field int othe processing script.
In my HTML I have this:
<g:ui_form> <g:dialog_buttons_ok_cancel ok="return true" /> <input type="hidden" name="incident_id" value="SYS_ID_OF_TICKET"/> <textarea id="comments" name="comments"></textarea> </g:ui_form>
My processing script has this:
var inc = new GlideRecord('incident'); inc.get(incident_id); inc.comments  = document.getElementById('comments'); inc.work_notes = "this is a test"; inc.update(); var urlOnStack = Packages.com.glide.sys.GlideSession.get().getStack().bottom(); response.sendRedirect(urlOnStack);
document.getElementById('comments'); does not work and I'm really not sure what to put here to pull the value from the comments textarea into the processing script. If it's possible to do inc.get to an input field to query the table, you'd think there would be a way to pass other form fields into a business rule.
Does anyone have any idea?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2012 05:28 PM
Try the following line instead:
inc.comments = comments;
The values of each form input are available via a variable with the same name as the name attribute of input element.
Have you considered using a cut-down version of the Form (using a View), instead of a custom UI Page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2015 02:49 PM
We were able to update work_notes fields from a processing script. The user has to authenticate first though which was an issue for us at the time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2016 01:47 PM
Instead of using OK and Cancel buttons, is it possible with just Submit. We need the same functionality with Submit button.
<g:dialog_buttons_ok_cancel ok="return true" />