The CreatorCon Call for Content is officially open! Get started here.

Escaping special character

Khanna Ji
Tera Guru

Hi,

How can I escape a special character in the client controller of the widget?  Basically I want to print something like below;

'${' + field_value + '}'

But when I do this, its printing

' + field_value + ' 

//Not printing any field value, just printed what is passed in the statement. 
//I just passed field_value. System did not fetch the value.

Here the special characters need to be escaped. There is no issue in fetching the field value in my code because if I just pass field_value, the system is returning the value for the field.

Any help on this?

2 REPLIES 2

Jaspal Singh
Mega Patron
Mega Patron

I guess, you will have to use g_form.setValue() or g_form.getValue() only.

This is actually in a client controller of the widget. I got a value from a field and stored in a variable. After that when I print it on widget, it's not showing as expected. I need it in the format : ${value}