I would appreciate any help you can provide on the following:
I this java script on an input form where the parameter [@SU_Type] is passed into the page through a link. THIS SCRIPT WORKS perfectly:
<h5><span id="business2" style="color:#263C87;">Company Information:</span></h5>
<script>
TypeC=[@SU_Type]
if(TypeC == 1) {document.getElementById("business2").style.display = "none"}
</script>
THE PROBLEM:
I'm trying to do something very similar on the email/destinations page of another form and it is NOT working. In this form the parameters [@Mailing_Addr_Type] and [@Mailing_Check] are being used in the form and should then be passed, which I am assuming makes them available for use on the Destinations page. However, no matter how I format them in the Jave on the Destinations page of the form the Java does not seem to read the values. I have tested the java itself on other sites and it works if a Value is assigned to md directly. What am I missing? This is my latest iteration, treating the variables as values on the same form as the Java. It does not work. I have tried the following parameter formats:
[@field:Mailing_Addr_Type] (with and without the # at the end)
[@Mailing_Addr_Type]
Thanks for taking the time to look at this.
CODE THAT IS NOT WORKING (with fake link info):
<h4>Your submission was successful.</h4>
<p id="answ3">If you wish to enter additional addresses:</p>
<p id="answ2">It appears that the address you entered was not a mailing address (or was not marked as one). Please click the link below and enter a mailing address that can be used in the letter of authorization document. This is required by the utility, not us. Thank you.</p>
<button onclick="location.href='https://www.GOOGLE.COM/'" type="button">Add another address</button>
<p><span id="answ1">Or, if you are done entering addresses: </span></p>
<span id="answ4"><button onclick="location.href='https://www.GOOGLE.COM/'" type="button">Proceed to the Letter of Agreement</button></span><br />
<br />
<script>
A=document.getElementById("InsertRecordMailing_Addr_Type").value;
B=document.getElementById("InsertRecordMailing_Check").value;
md=A+B
if(md==0) { document.getElementById("answ1").style.display="none";
document.getElementById("answ3").style.display="none";
document.getElementById("answ4").style.display="none";
}
else { document.getElementById("answ2").style.display="none";
document.getElementById("InsertRecordMailing_Check").value=1;
}
</script>