none
Uncaught SyntaxError: missing ) after argument list

    Question

  • Hi,

    Today one of my SharePoint 2013 client complained about following scenario.

    1. Create site with apostrophe in the name and url (e.g. Title: Richard's Will/ Url: richard'swill)

    Result: success

    2. Create list or document library with at least one date/time column.

    Result: success

    3. Add new item and select the date/time field (click the calendar icon on EditForm.aspx)

    Result: calendar doesn't open

    When I debug using the developer toolbar it shows Uncaught SyntaxError: missing ) after argument list in https://<sitename>/<site>/Richard%27sWill/Concent%20Documents/Forms/EditForm.aspx?ID=1&Source=<site>%2FConcent%2520Documents%2FForms%2FAllItems%2Easpx&ContentTypeId=0x010100CD3582C6AEAD8F40ABC93A1927883468&RootFolder=%2FLegal%2FSharePointTeam%2FRichard%27sWill%2FConcent%20Documents

    Our SharePoint version is 15.0.4693.1000

    It looks like SharePoint bug but I couldn't find any artifact on same or similar error so please help me on this. Thanks in advance.

    Cheers,

    Lilupa.

    Thursday, December 03, 2015 1:53 AM

Answers

  • Hi Lilupa,

    I tested the same scenario per your post, and I got the same results as you got.

    I found that there is an onclick event for the date picker control which will return a parameter as below shows:

    “clickDatePicker('date_ba617e44-3b5d-4677-b356-fdde744a07a5_$DateTimeFieldDate', '/richard’swill/_layouts/15/iframe.aspx?cal=1&lcid=2057&langid=1033&tz=-10:00:00.0003928&ww=0111110&fdow=1&fwoy=2&hj=0&swn=false&minjday=109207&maxjday=2666269&date=', '', event); return false;”

    If we change the apostrophe in the URL to “%27” in the returned parameter, the data picker works fine.

    So as a workaround, I recommend to use JavaScript to modify the apostrophe in the URL to “%27” in the returned parameter as below shows:

    “clickDatePicker('date_ba617e44-3b5d-4677-b356-fdde744a07a5_$DateTimeFieldDate', '/richard%27swill/_layouts/15/iframe.aspx?cal=1&lcid=2057&langid=1033&tz=-10:00:00.0003928&ww=0111110&fdow=1&fwoy=2&hj=0&swn=false&minjday=109207&maxjday=2666269&date=', '', event); return false;”

    Best regards,

    Victoria

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.




    Friday, December 04, 2015 6:20 AM
    Moderator

All replies

  • Hi Lilupa,

    I tested the same scenario per your post, and I got the same results as you got.

    I found that there is an onclick event for the date picker control which will return a parameter as below shows:

    “clickDatePicker('date_ba617e44-3b5d-4677-b356-fdde744a07a5_$DateTimeFieldDate', '/richard’swill/_layouts/15/iframe.aspx?cal=1&lcid=2057&langid=1033&tz=-10:00:00.0003928&ww=0111110&fdow=1&fwoy=2&hj=0&swn=false&minjday=109207&maxjday=2666269&date=', '', event); return false;”

    If we change the apostrophe in the URL to “%27” in the returned parameter, the data picker works fine.

    So as a workaround, I recommend to use JavaScript to modify the apostrophe in the URL to “%27” in the returned parameter as below shows:

    “clickDatePicker('date_ba617e44-3b5d-4677-b356-fdde744a07a5_$DateTimeFieldDate', '/richard%27swill/_layouts/15/iframe.aspx?cal=1&lcid=2057&langid=1033&tz=-10:00:00.0003928&ww=0111110&fdow=1&fwoy=2&hj=0&swn=false&minjday=109207&maxjday=2666269&date=', '', event); return false;”

    Best regards,

    Victoria

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.




    Friday, December 04, 2015 6:20 AM
    Moderator
  • I have got the same issue and unfortunately there is no fix provided by Microsoft for this.

    The problem was, if there is an Apostrophe in site name, the DataTime picker do not work in custom lists. In OOTB SharePoint calendar list works fine in that case. At the end, i had to remove Apostrophe ( ' ) from the site name and everything works fine. 

    This question really helped me to resolve this issue. See more details here.

    Thanks


    Saturday, May 20, 2017 9:36 AM