ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

IE Error when using SafeCracker

August 31, 2011 2:20pm

Subscribe [6]
  • #1 / Aug 31, 2011 2:20pm

    columbusphil

    67 posts

    I recently added a SafeCracker form and it works great in all browsers.  However, I keep getting the following error in IE7-9 (even though the form seems to work just fine..)  The error is not present in Firefox, Safari or Chrome…

    SCRIPT1006: Expected ')'
    signup, line1 character 30

    I’ve traced the error back to a script that SafeCracker references following the form:

    <a href="http://allianceforcompetitiveelectricity.com/?ACT=10&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1312213360&use_live_url=y&include_jquery=y">http://allianceforcompetitiveelectricity.com/?ACT=10&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1312213360&use_live_url=y&include_jquery=y</a>

    To track this down, I simply copied the source of a rendered page and gradually removed the scripts… this turned out to be the problem.  Does anyone know a way to fix this - or has anyone else experienced this in IE?

    Here is my Safecracker code:

    <?php $title_ad = date('Y-m-d'); ?>
        {exp:safecracker channel="ace_mailing_list" return="take-action/thanks" logged_out_member_id="4" rules:email_address="required|valid_email" json="yes"}
        <fieldset>
                <div id="close-button"></div>
                <h2>Sign up for E-mail Alerts</h2>
    <p>            <!-- Hidden Fields --><br />
                <input type="hidden" name="title" value="Mailing List Entry <?= $title_ad ?>"  /><br />
                <!-- End Hidden Fields --><br />
            <ul class="form"><br />
                <li><br />
                    <label for="first_name">First Name:</label><br />
                    <input type="text" name="first_name" id="first_name" size="20" maxlength="100" /><br />
                </li><br />
                <br />
                <li><br />
                    <label for="last_name">Last Name:</label><br />
                    <input type="text" name="last_name" id="last_name" size="20" maxlength="100" /><br />
                </li><br />
                <br />
                <li><br />
                    <label for="email_address">E-mail Address:<span class="required">*</span></label><br />
                    <input type="email" name="email_address" id="email_address" size="20" maxlength="100" /><br />
                </li><br />
                <br />
                <li><br />
                    <input type="submit" value="Submit" /><br />
                </li><br />
            </ul><br />
            <div id="result"></div><br />
            </fieldset><br />
        {/exp:safecracker}

  • #2 / Sep 01, 2011 12:21am

    Dan Decker

    7338 posts

    columbusphil,

    Are you including your own version of jQuery on the page? If so, you can set the SafeCracker parameter include_jquery=“no”. That may be causing a conflict for you.

    Cheers,

  • #3 / Sep 01, 2011 6:54am

    tidy

    196 posts

    I am also seeing this error with SafeCracker in IE8 (EE 2.2.2):
    Expected ‘)’ line 1 character 30 just like the first poster.

    I am using my own version of jQuery (and have tried a few different versions).

    But I have also done a couple of basic examples of the SafeCracker form (with no other scripts on the page) and still get the error:
    Test 1: used SafeCracker jQuery and just text input and textarea fields
    Test 2: used SafeCracker jQuery and just a title and file field

  • #4 / Sep 01, 2011 11:13pm

    Dan Decker

    7338 posts

    tidy,

    Does this error present itself in any other browsers, or only IE8? If it is only IE 7/8, we may have a rather specific bug to track down.

    Cheers,

  • #5 / Sep 01, 2011 11:28pm

    columbusphil

    67 posts

    Hi Dan,

    Thanks for your help—yeah, I initially suspected two loads of jQuery as well.  However, I looked at the source to make sure and if I set include_jquery to no then I get several jQuery not defined errors indicating that it hadn’t been loaded beforehand.  On pages where I set safecracker_head=“no”, I obviously no longer receive the errors.

    Tidy:  Thanks for trying to load your own version; I hadn’t gotten around to it.  Again, it doesn’t seem to impede functionality… at least, not for what I’m using it.  I also got the error in IE9… just checked…

    Added Info: I’m also using the same EE version as Tidy.

    Thanks again for your help—I appreciate it..

  • #6 / Sep 02, 2011 6:32am

    tidy

    196 posts

    Hi Dan,

    Using the IE Tester IE emulator, I seem to get the error in IE7 and IE8 but not IE6 - not sure whether the emulator would be 100% accurate with regard to these things though.

    Thanks

  • #7 / Sep 03, 2011 6:40pm

    Dan Decker

    7338 posts

    columbusphil and tidy,

    Since I’m not able to test IE functionality, I’m going to ping the Devs on this to see if they have any insight to offer.

    Cheers

  • #8 / Sep 03, 2011 6:51pm

    tidy

    196 posts

    Thanks Dan - I’d appreciate that

  • #9 / Sep 06, 2011 10:10pm

    Dan Decker

    7338 posts

    tidy,

    I’m still waiting on word from the Devs on this. I’ll ping them again.

    Cheers,

  • #10 / Sep 06, 2011 10:10pm

    Dan Decker

    7338 posts

    dev

  • #11 / Sep 07, 2011 11:33am

    tidy

    196 posts

    Thanks for the update Dan

  • #12 / Sep 08, 2011 12:36am

    Dan Decker

    7338 posts

    Dev

  • #13 / Sep 09, 2011 4:22pm

    Robin Sowell

    13255 posts

    Hrm- I’m not getting the error in ie7 tested on a windows box.

    I copied your exact form, but any chance of linking me to it in action, columbusphil?  May be a difference in our installs.

  • #14 / Sep 12, 2011 6:57pm

    Henrik Eklund

    34 posts

    Any solution to this? We have the same problem in IE8..

    /Henrik

  • #15 / Sep 12, 2011 8:58pm

    Robin Sowell

    13255 posts

    Henrik, I’m not replicating.  Could you link me to a form where I can see it in action?  (Possible only if the form is open to non-members, I realize).

    I tested with the exact form used in the initial post, using IE7 (no emulator).  Granted, it could be a version difference, and I suspect it is.  But if so, a quick comparison would let me narrow in on the cause.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases