We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Assigning empty string

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
aliasg
Posts: 24
Joined: Sat Mar 14, 2009 1:23 am

Assigning empty string

Post 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]
Ali

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code for assigning an empty string

Post 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

Post Reply