Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 03, 2018 @ 16:32
    Ismail Mayat
    0

    javascript error on submit

    I have a form with a number of a fields. One of the fields is a select the values contain heights which a user must pick e.g

    enter image description here

    as you can see the value and text contains single and double quotes. The values come from prevalues data type property.

    Completing all fields and submitting everything works fine you get the thank you message and you can see submitted data in the backoffice.

    When i submit the form with out completing all fields then i get the page back as expected but in console there is js error:

    Uncaught Error: Syntax error, unrecognized expression: option[value='5' 7½" – 172cm']

    I have tried to html encode in the drop down partial the issue then is i get encoded data in the backoffice. Wierd thing is this is only issue when there is validation error after a submit, which in my case is due to incorrect upload type or size of upload to big.

    Anyone seen this before?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    May 03, 2018 @ 18:03
    Dan Diplo
    0

    If you think it's the quotes could you replace with a different quote symbol? http://www.amp-what.com/unicode/search/quote

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 04, 2018 @ 09:43
    Ismail Mayat
    0

    Dan,

    For now i have just replaced the ' in the value with a space. All works just in backoffice for the submitted value you don't see the '. Using ' or ' would result in that showing in the backoffice unless in forms there is way of tapping into that dashboard for viewing a record and using UrlDecode on it.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft