Jump to content

Referencing A Virtual Field In A Submission Form Html Block


Recommended Posts

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>
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 5 years later...

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

 

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...