Altair Posted August 19, 2019 Report Share Posted August 19, 2019 I was using the following document.write() code to display information in the "Head" section of a results page. This code no longer works due to support being dropped for document.write(). I know from your website that document.getElementById("mydiv[@field:UNIQUE]").innerHTML is the replacement but I am having a problem getting it work. If you could point out the correct syntax for one of the following document.write() lines, it would be greatly appreciated. <table width="600" border="0"><tr><td width="130"><script type="text/javascript">/*Following javascript displays fields not shown in the data table (values do not change). These fields do not need to be added in panel to left to be accessible via javascript. Since these fields on the results form are display only, those elements on the web page do not have ID’s so using document.getElementById will not work. To confirm this, the source of the page can be viewed in the URL provided when deploying the page.*/document.write('<span style="font-family:arial;color:#425A10;font-size:15px;"><b>Operator: </b></span>');document.write('<p style="font-family:arial;color:#444444;font-size:12px;">[@field:first_name] [@field:last_name]</p>');</script></td><td width="160"><script type="text/javascript">document.write('<span style="font-family:arial;color:#425A10;font-size:15px;"><b>Operator ID: </b></span>');document.write('<p style="font-family:arial;color:#444444;font-size:12px;">[@field:opnumber]</p>');</script></td><td width="296"><script type="text/javascript">document.write('<span style="font-family:arial;color:#425A10;font-size:15px;"><b>Employer: </b></span>');document.write('<p style="font-family:arial;color:#444444;font-size:12px;">[@field:employer]</p>');</script></td></tr></table> Quote Link to comment Share on other sites More sharing options...
Nuke354 Posted August 19, 2019 Report Share Posted August 19, 2019 Here is an example to change document.write code from https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/tech-tip-generating-geolocation-coordinates-from-web-form-submissions/ article: 1. Define an id of some type <p>, <span>, etc. outside the <script>. 2. Within the script, then add the innerHTML code. <span id="error_message"> </span> <script type='text/javascript'> . . . document.getElementById("error_message").innerHTML = "This Datapage require Standard Caspio Deployment for full functionality." ; . . </script> In your case, if I take one example: <table width="600" border="0"> <tr> <td width="130"> <span id="font_change"> </span> <script type='text/javascript'> document.getElementById("font_change").innerHTML='<span style="font-family:arial;color:#425A10;font-size:15px;"><b>Operator: </b></span>'; </script> Please try the above format for all your document.write statements. I hope that helps. 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.