Undefined variable in Javascript?
Posted: Mon Oct 23, 2017 3:57 pm
Hi Folks,
I can't figure out why the variable highlighted in red is undefined within the script. Your help is very much appreciated.
Thanks...Scott
<vml ...
<vxml ....
<var name="invitation_code"/>
<form id="invitation">
<field name="inv_code" type="digits?length=8">
<prompt bargein="false">
We sent you an invitation email. Please enter your unique 8 digit invitation code included in this email.
</prompt>
<filled>
<assign name="invitation_code" expr="inv_code"/>
</filled>
<noinput count="1">
<prompt bargein="false">
Sorry, I didn't hear you.
</prompt>
<reprompt/>
</noinput>
<noinput count="2">
<prompt bargein="false">
You did not enter anything. Your unique 8 digit invitation code is included in your invitation email. Please enter it now.
</prompt>
<reprompt/>
</noinput>
<noinput count="3">
<prompt bargein="false">
You seem to be having some trouble. Please contact our support team at the telephone number included in your invitation email.
</prompt>
</noinput>
</field>
<block>
<log label="scottlog">
inv_code is <value expr="inv_code"/> invitation_code is <value expr="invitation_code"/>
</log>
</block>
<!-- call API to verify invitation code and request activation code -->
<script>
// <![CDATA[
var json_data = new Object();
json_data.orgid = String(orgid);
json_data.action = "get";
json_data.cid = invitation_code;
var json_string= JSON.stringify(json_data);
// ]]>
</script>
<block>
<log label="scottlog">
JSON data is <value expr="json_string"/>
</log>
</block>
</form>
I can't figure out why the variable highlighted in red is undefined within the script. Your help is very much appreciated.
Thanks...Scott
<vml ...
<vxml ....
<var name="invitation_code"/>
<form id="invitation">
<field name="inv_code" type="digits?length=8">
<prompt bargein="false">
We sent you an invitation email. Please enter your unique 8 digit invitation code included in this email.
</prompt>
<filled>
<assign name="invitation_code" expr="inv_code"/>
</filled>
<noinput count="1">
<prompt bargein="false">
Sorry, I didn't hear you.
</prompt>
<reprompt/>
</noinput>
<noinput count="2">
<prompt bargein="false">
You did not enter anything. Your unique 8 digit invitation code is included in your invitation email. Please enter it now.
</prompt>
<reprompt/>
</noinput>
<noinput count="3">
<prompt bargein="false">
You seem to be having some trouble. Please contact our support team at the telephone number included in your invitation email.
</prompt>
</noinput>
</field>
<block>
<log label="scottlog">
inv_code is <value expr="inv_code"/> invitation_code is <value expr="invitation_code"/>
</log>
</block>
<!-- call API to verify invitation code and request activation code -->
<script>
// <![CDATA[
var json_data = new Object();
json_data.orgid = String(orgid);
json_data.action = "get";
json_data.cid = invitation_code;
var json_string= JSON.stringify(json_data);
// ]]>
</script>
<block>
<log label="scottlog">
JSON data is <value expr="json_string"/>
</log>
</block>
</form>