Page 1 of 2

I get an error in the console when I change the value of a select menu.

Posted: Mon Mar 30, 2015 11:42 pm
by Ellen Schlechter

I only get this error when I change to certain values and I've noticed that those values contain an" ' " (apostrophe).These are user made values.

Is there a simple fix to this error

[Error] Error: Syntax error, unrecognized expression: option[value='Chad's place']:eq(0)

Here is the public link.
http://appery.io/app/mobile-frame?src...


I get an error in the console when I change the value of a select menu.

Posted: Tue Mar 31, 2015 11:24 am
by Egor Kotov6832188

Hello Ellen,

Javascript has to ways to define string type variable
var myString1 = 'value1';
OR
var myString2 = "value2";

There is no difference, both are 100% alike to run-time machine.
In your case variable ends after 'd', best way is to do next:
option[value="Chad's place"]:eq(0)


I get an error in the console when I change the value of a select menu.

Posted: Tue Mar 31, 2015 1:59 pm
by Ellen Schlechter

I see what you are saying but this isn't implemented with JS. I did it with mapping and the events.

If it would help, my app is shared with support and called The Calving Book.


I get an error in the console when I change the value of a select menu.

Posted: Wed Apr 01, 2015 6:50 pm
by Alena Prykhodko

Please show us your mapping and events you use.


I get an error in the console when I change the value of a select menu.

Posted: Wed Apr 01, 2015 9:28 pm
by Ellen Schlechter

Image Image

This is the mapping that populates the select menu. It is called mainscreenlist.Image Image


I get an error in the console when I change the value of a select menu.

Posted: Fri Apr 03, 2015 12:09 am
by Yurii Orishchuk

Hi Ellen,

Please give us your app public link here and specify steps to reproduce this issue in your app.

Thanks.


I get an error in the console when I change the value of a select menu.

Posted: Fri Apr 03, 2015 2:22 am
by Ellen Schlechter

http://appery.io/app/mobile-frame?src...

Sign in with a href="mailto:schlechter3@icloud.com" rel="nofollow"schlechter3@icloud.com/a and password Terry1228. In the larger select menu in the header select Chad's Place


I get an error in the console when I change the value of a select menu.

Posted: Mon Apr 06, 2015 1:39 am
by Yurii Orishchuk

Hi Ellen,

It seems you try to set select value that contains apostrophe via mapping. Please use escaping function for this:

precode

return value.replace(/([ #;?&,.+*~/code:"!^$[\]()=>|\/@])/g,'\$1');

/pre

Regards.


I get an error in the console when I change the value of a select menu.

Posted: Mon Apr 06, 2015 1:41 am
by Ellen Schlechter

Do I put that in the js mapping where the select menu is populated?


I get an error in the console when I change the value of a select menu.

Posted: Mon Apr 06, 2015 11:43 pm
by Yurii Orishchuk

Hi Ellen,

Yes you need to put this code into JS section of the link to the "Selected" property of the goal select component.

Regards.