Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

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

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...

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

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

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)

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

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

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.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

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

Please show us your mapping and events you use.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

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

Image Image

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

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

Hi Ellen,

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

Thanks.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

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

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

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

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.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

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

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

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

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.

Return to “Issues”