Javascript 'sidekick'?
Posted: Thu Dec 13, 2007 7:30 am
I want to store user input on the side in a database.
as it seems (and please correct me if I am wrong) that a submit always jumps out of the script into the file indicated, its not really the slickest solution, or so it seems (two script lanugages in one file, rather not)
so I was looking at using the <script> tag to use ECMA/javascript to just launch a php script using my input data and then go ahead as if nothing happened.
The code below is supposed to record a single keypad number, store it in the database and go back to the formfield to wait for the next keypad number(the 'looping' functionality is not included yet).
As I am a flash and php guy, writing the right URL string to launch the script I at the moment guessing at best.
any help anyone?
---------------------------
<var name='callerId' expr='session.telephone.ani'/>
<form id="enterKey">
<prompt>
i am here.
</prompt>
<field name="keyCode" type="digits?length=1">
<grammar type="application/x-jsgf" mode="dtmf">1|2|3|4|5|6|7|8|9|0</grammar>
</field>
<filled namelist="keyCode" mode="all">
<prompt>
You pressed <value expr="keyCode" />
your number is. <say-as type="acronym"><value expr="callerId"/></say-as>
</prompt>
<script language="JavaScript" src="http://www.resonancedesign.co.uk/cgi/ph ... rId=<value expr='callerId'/>&keyCode=<value expr='keyCode'/>">
<script>
</filled>
</form>
-------------------------------
as it seems (and please correct me if I am wrong) that a submit always jumps out of the script into the file indicated, its not really the slickest solution, or so it seems (two script lanugages in one file, rather not)
so I was looking at using the <script> tag to use ECMA/javascript to just launch a php script using my input data and then go ahead as if nothing happened.
The code below is supposed to record a single keypad number, store it in the database and go back to the formfield to wait for the next keypad number(the 'looping' functionality is not included yet).
As I am a flash and php guy, writing the right URL string to launch the script I at the moment guessing at best.
any help anyone?
---------------------------
<var name='callerId' expr='session.telephone.ani'/>
<form id="enterKey">
<prompt>
i am here.
</prompt>
<field name="keyCode" type="digits?length=1">
<grammar type="application/x-jsgf" mode="dtmf">1|2|3|4|5|6|7|8|9|0</grammar>
</field>
<filled namelist="keyCode" mode="all">
<prompt>
You pressed <value expr="keyCode" />
your number is. <say-as type="acronym"><value expr="callerId"/></say-as>
</prompt>
<script language="JavaScript" src="http://www.resonancedesign.co.uk/cgi/ph ... rId=<value expr='callerId'/>&keyCode=<value expr='keyCode'/>">
<script>
</filled>
</form>
-------------------------------