- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 10:25 AM
On my form I have a field that shows the requester's email address when the form loads:
in order to get this done , on the default value of the filed i have :
Now , on the form, if someone selects yes in (Is this on behalf of someone else?) , in the ( on behalf of) they can select another user. so if this happens , i need the user's email address pop up in another field. what is the easiest way to achieve this?
Solved! Go to Solution.
- 8,254 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:09 AM
function onChange(control, oldValue, newValue, isLoading) {
alert("Value of on_behalf_ref is: "+ on_behalf_ref);
var usr= g_form.getReference('on_behalf_ref', doAlert);
}
function doAlert(usr) {
if (usr.email != '')
alert("email is: " + usr.email);
g_form.setValue('requested_for', usr.email);
}
Can you try this, and tell me what are the alert messages (there should be 2 messages).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:01 AM
this approach again shoes the email of the logged in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:09 AM
function onChange(control, oldValue, newValue, isLoading) {
alert("Value of on_behalf_ref is: "+ on_behalf_ref);
var usr= g_form.getReference('on_behalf_ref', doAlert);
}
function doAlert(usr) {
if (usr.email != '')
alert("email is: " + usr.email);
g_form.setValue('requested_for', usr.email);
}
Can you try this, and tell me what are the alert messages (there should be 2 messages).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:57 AM
Working as expected. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 11:24 AM
Hi Soni,
Try this:
1) delete the default value of email address field (for this we can use onload client script). Try Onchange script now.
2) If the field hide/show issue still exist, can you comment that part of the code and use UI Policy.
Please let me know if the solution works!
Thanks
Kunpriya