Page 1 of 1

Assigning empty string

Posted: Tue Mar 31, 2009 1:40 am
by aliasg
When I use "document.StartNo" expr = "" in assign tag it generates following error. If I give empty space like following statement, it works fine. "document.StartNo" expr = " "

Any idea what is error? No script tag on the page.



dtmf input: 1
Found grammar match
hypothesis #0: 1 (0.9990)
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak><voice gender="female" name="Diane"><speak xml:lang="en-us">

When you hear the message title and number you would like to delete, press # key.
</speak></voice></speak>
---------
VXI::assign_element(name="document.StartNo" expr = "")
errno: 212 message JavaScript error
Call End Event
Ending session
Ending Session On Channel 30
[/code]

IVR code for assigning an empty string

Posted: Tue Mar 31, 2009 9:04 am
by support
Hi,

The reason you are seeing that IVR error is because <assign name="document.StartNo" expr = ""/> translates to:

document.StartNo = ;

in javascript, which is illegal javascript.

To assign an empty string, you should do the following:

Code: Select all

<assign name="document.StartNo" expr = "''"/>
which would translate to:

document.StartNo = '';

Hope this sample IVR code using the IVR tag, <assign>, helps.

Regards,
Plum Support