My Ellucian's Colleague playground with all tips and tricks I learned as a programmer.
Thursday, May 9, 2013
Submit the form when a drop down menu item is selected in Webadvisor
In field output of a VAR variable, enter the following:
OUTPUT.DATA := '<script type="text/javascript">'
OUTPUT.DATA := "document.getElementById('VAR1').onchange = submit;"
OUTPUT.DATA := 'function submit() {document.datatelform.submit();}'
OUTPUT.DATA := '</script>'
In this case, VAR1 field contains the drop down menu. This code needs to be parsed after VAR1. For instance, if you insert the above code in VAR2 output field, VAR2 needs to be below VAR1 in UI Form Field Sequence.
Note that this has only been tested with standalone webadvisor. I am not sure if this will work with webadvisor webpart inside colleague portal. If it does, the document and field name may need to change accordingly.
Labels:
code,
Colleague,
datatel,
dropdown menu,
envision,
form,
javascript,
portal,
script,
submit,
unibasic,
unidata,
webadvisor
Subscribe to:
Post Comments (Atom)
I was using this script document.getElementById("datatelform").submit();, however, it is not working properly. This working fine for me: document.datatelform.submit();}
ReplyDeleteThank you!
Huy
The form ID may not be "datatelform", so that's why the lookup "getElementById" doesn't work.
ReplyDelete