I am attempting to receive a large response from the caller. It appears to be received properly but at some point either there or in the JavaScript code is is being expressed exponentially.
Below is the snip of the code where I receive the number then add to an XML packet.
Example:
user enters 12345678901234567890123
JavaScript converts to 1.2345678901234567e+22
Obviously this does not work. I am new to VXML and JavaScript (should be obvious )
Code snip as follows:
...
<field name="BigNum" type="digits?minlength=15">
<prompt>
Please enter all the numbers that appear on your document, followed by the pound key.
</prompt>
<filled>
<assign name="obj.BigNum" expr="BigNum"/>
</filled>
</field>
The code listed below functions to your specifications given the information provided, the variable ("BigNum") received from the VXML will be of type string.
I removed the "obj" variable, if you'd like to create a JavaScript object using the "obj" variable you'll need to define it inside a <script> tag and assign object properties as you would in any other JS environment.
<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf"/>
<form>
<field name="BigNum" type="digits?minlength=15">
<prompt>
Please enter all the numbers that appear on your document, followed by the pound key.
</prompt>
<filled>
<assign name="BigNum" expr="BigNum"/>
</filled>
</field>
<block>
<script>
<![CDATA[
function Getdocument(){
var document = "<>" + "<>" + BigNum + "</>" + "</>";
return document;
}
]]>
</script>
<prompt> value is <value expr="Getdocument()"/> </prompt>
</block>
</form>
</vxml>
The code listed below functions to your specifications given the information provided, the variable ("BigNum") received from the VXML will be of type string.
I removed the "obj" variable, if you'd like to create a JavaScript object using the "obj" variable you'll need to define it inside a <script> tag and assign object properties as you would in any other JS environment.
<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf"/>
<form>
<field name="BigNum" type="digits?minlength=15">
<prompt>
Please enter all the numbers that appear on your document, followed by the pound key.
</prompt>
<filled>
<assign name="BigNum" expr="BigNum"/>
</filled>
</field>
<block>
<script>
<![CDATA[
function Getdocument(){
var document = "<>" + "<>" + BigNum + "</>" + "</>";
return document;
}
]]>
</script>
<prompt> value is <value expr="Getdocument()"/> </prompt>
</block>
</form>
</vxml>
Thanks. It was defined outside the script.
I actually found what appears to be a simpler solution in the JavaScript. Concatenating a null string seem to be working.
I do not see what your solution did that mine did not other than pull BigNum out as it' own variable which would then have to be added BACK into the document variable so it could be processed.