This is topic Variables in forum Newbies at VoiceXML Forum Community Message Board.


To visit this topic, use this URL:
http://www.voicexml.org/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic;f=3;t=000150

Posted by tojo933 (Member # 3691) on August 05, 2006, 07:19 PM:
 
This script is meant to assign a variable (a) using menu script and then pass that var and login info using form id="login>. It does not pass (a) correctly. Am I missing something?

code:
 
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<property name="inputmodes" value="dtmf"/>
<var name = "a" />
<menu id="menu1" dtmf="true">
<prompt> Press 1 to xxxx. Press 2 to xxxxx. Press 3 to xxx.</prompt>
<choice next="#choice1">1</choice>
<choice next="#choice2">2</choice>
<choice next="#choice3">3</choice>
</menu>
<form id="choice2">
<assign expr = "3" name = "a" />
<block><goto next="#login"/></block>
</form>
<form id="choice3">
<assign expr = "4" name = "a" />
<block><goto next="#login"/></block>
</form>
<form id="login">
<field name="id" type="number">
<prompt>Please enter your user eye dee followed by the pound key</prompt>
</field>
<field name="pin" type="digits?minlength=7;maxlength=7">
<prompt>Please enter your pin</prompt>
<filled>
<submit next="http://www.tojo931.com/gmaps/voicexml.php" namelist="id pin a"/>
</filled>
</field>
</form>
</vxml>


 
Posted by mheadd (Member # 3181) on August 06, 2006, 09:41 PM:
 
Yes. You must assign a value to "a" within the <block> tags. Since <assign> is not a legal child of the form tag, the assignment is not happening properly.

Depending on the tool/environment that you are using, you can usually validate your code before running to make sure its correct.

You should also check the platform logs -- this script should throw an "error.semantic" that you should be able to see fairly easily.

Hope this helps.
 




Powered by Infopop Corporation
UBB.classicTM 6.3.1.2