ababcock Posted March 7, 2016 Report Share Posted March 7, 2016 I have an HTML block in a submission form, and I'm trying to bring up some info based on the client selected. I created 10 virtual fields that use cascading dropdowns to retrieve this info. The virtual fields are hidden, and I am trying to show their results in an HTML block. Here is what I have come up with, but it's not showing the results on the deployed page. I checked the virtual fields, and they are bringing up the right information, so I must not be referencing it right in the HTML block. Does anyone know how to fix it? Thanks!! <div style="background:#e9e9e9;width: 300px"> <b>Potential contacts:</b><br /> <b>Case Manager:</b> <script>document.getElementById("cbParamVirtual1")</script> <b>Emergency Contact:</b> <script>document.getElementById("cbParamVirtual2")</script> <b>Physician:</b> <script>document.getElementById("cbParamVirtual3&";)</script> <b>Psychiatrist:</b> <script>document.getElementById("cbParamVirtual4")</script> <b>Therapist:</b> <script>document.getElementById("cbParamVirtual5")</script> <b>Advocate:</b> <script>document.getElementById("cbParamVirtual6")</script> <b>Pharmacy:</b> <script>document.getElementById("cbParamVirtual7")</script> <b>Employer:</b> <script>document.getElementById("cbParamVirtual8")</script> <b>Payee:</b> <script>document.getElementById("cbParamVirtual9")</script> <b>Guardian:</b> <script>document.getElementById("cbParamVirtual10")</script></div> Quote Link to comment Share on other sites More sharing options...
DataCobalt Posted March 7, 2016 Report Share Posted March 7, 2016 I am definitely not a JS expert, but would adding ".value" to the end of those scripts print the value to the section? Quote Link to comment Share on other sites More sharing options...
ababcock Posted March 9, 2016 Author Report Share Posted March 9, 2016 Like this? Also not a JS expert -- just piecing it together as I go! <script>document.getElementById.value("cbParamVirtual1")</script> Quote Link to comment Share on other sites More sharing options...
LWSChad Posted March 11, 2016 Report Share Posted March 11, 2016 document.getElementById('elementID').value; "value" comes after the element is identified value, innerHTML, style, onchange, etc. all come after the element is identified EDIT: I can't tell if you need javascript or not. If not... <b>Case Manager: [@cbParamVirtual1]</p> <b>Emergency Contact: [@cbParamVirtual2]</p> If it's the same page obviously you know you need it, if it's two pages this example should work. Quote Link to comment Share on other sites More sharing options...
MarkMayhrai Posted November 20, 2021 Report Share Posted November 20, 2021 Hello, I've this same situation to address and havn't figured out how to from this atricle. Can someone help me out here, please? Quote Link to comment Share on other sites More sharing options...
Kurumi Posted November 22, 2021 Report Share Posted November 22, 2021 Hi @MarkMayhrai - replied to this post: Quote Link to comment Share on other sites More sharing options...
HeyItsDoug Posted November 23, 2021 Report Share Posted November 23, 2021 I think my question is related to this topic... I have a virtual field on a table view detail screen that contains a single value SELECT statement, fetching a street address, using an emp ID retrieved from a dropdown on the same form. I use this street address in an HTML Block to retrieve and display a google map with the fetched address. It all works fine except when the user changes employees on the dropdown and the virtual field updates with the new address, the reference to the virtual field in the HTML BLOCK does not update. How can I ensure the virtual field reference in the HTML BLOCK updates in real-time? HTML BLOCK: NOTE - [@calcfield1] is a static street address. <script type="text/javascript"> // Popup window code function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=600,width=900,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> <a href="JavaScript:newPopup('http://maps.google.com/maps?saddr={[@calcfield:1]}&daddr={[@cbParamVirtual1]}');">Map Route</a></p><font color=#a52a68> Thanks for any suggestions Doug Quote Link to comment Share on other sites More sharing options...
Kurumi Posted December 6, 2021 Report Share Posted December 6, 2021 Hi @HeyItsDoug - have you tried this? Quote Link to comment Share on other sites More sharing options...
Kurumi Posted December 6, 2021 Report Share Posted December 6, 2021 Can you also try this code: <script type="text/javascript"> // Popup window code function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=600,width=900,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> <a href="JavaScript:newPopup('http://maps.google.com/maps?saddr=[@calcfield:1]&daddr=[@cbParamVirtual1]');">Map Route</a></p><font color=#a52a68> Remove the curly braces ({}) between parameters Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.