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.

Form code not working when submitted in Internet Explorer

January 16, 2012 2:54pm

Subscribe [2]
  • #1 / Jan 16, 2012 2:54pm

    Weird bug I came across…

    I have some form code from Hubspot that I want to include on some pages.
    When I paste it into a channel field text area that I have set up it works fine in Safari and FF.
    When I do the same thing in IE the form breaks for some reason.

    The form is located here http://skodamin.www66.a2hosting.com/marketing/contact/

    Say I were to go into the CMS and edit that entry and resubmit through IE, the form wouldn’t show up any longer.
    Are there any known bugs I should be aware of with certain things in the CMS not working with IE?

    Here’s the code from Hubspot that I’m copying/pasting. Nothing that I would think could cause issues.

    <form action="http://web.skodaminotti.com/Default.aspx?app=iframeform&hidemenu=true&ContactFormID=65636" method="post">
        <input type="hidden" name="FormSubmitRedirectURL" id="FormSubmitRedirectURL" value="http://marketing.skodaminotti.com/thank-you/" >
        <input type="hidden" name="Lead_Src" id="LeadSrc" value="Contact Us" />
        
        
    [removed]/* <![CDATA[ */
       HubSpotFormSpamCheck_LeadGen_ContactForm_65636_m0 = function() {
           var key = document.getElementById('LeadGen_ContactForm_65636_m0spam_check_key').value;
        var sig = '';
        for (var x = 0; x< key.length; x++ ) {
        sig += key.charCodeAt(x)+13;
        }
        document.getElementById('LeadGen_ContactForm_65636_m0spam_check_sig').value = sig; 
           /* Set the hidden field to contain the user token */
           var results = [removed].match ( '(^|;) ?hubspotutk=([^;]*)(;|$)' );
            if (results && results[2]) {
                document.getElementById('LeadGen_ContactForm_65636_m0submitter_user_token').value =  results[2];
            } else if (window['hsut']) {
                document.getElementById('LeadGen_ContactForm_65636_m0submitter_user_token').value = window['hsut'];
         }
            return true;
       };
    /*]]>*/[removed]
    
    <input type='hidden' id='LeadGen_ContactForm_65636_m0submitter_user_token' name='LeadGen_ContactForm_65636_m0submitter_user_token'  value='' /><input type='hidden' name='ContactFormId'  value='65636' ><input type='hidden' id='LeadGen_ContactForm_65636_m0spam_check_key' name='LeadGen_ContactForm_65636_m0spam_check_key'  value='osndonimgmdmoemprldmmgednrqiqgdslgpmmdoeljtctnkclhppuwfrenmo' /><input type='hidden' id='LeadGen_ContactForm_65636_m0spam_check_sig' name='LeadGen_ContactForm_65636_m0spam_check_sig'  value='' ><div class='ContactFormItems FormClassID_65636'><table border="0" cellspacing="0" cellpadding="5">
    <tr><td> </td><td>First Name</td></tr>
    <tr><td> </td><td><input type="Text" name="LeadGen_ContactForm_65636_m0:FirstName" class="StandardI AutoFormInput LeadGen_ContactForm_65636_m0_AutoForm" id="LeadGen_ContactForm_65636_m0_FirstName" value="" /><div class="fieldclear"></div></td></tr>
    <tr><td> </td><td>Last Name</td></tr>
    <tr><td> </td><td><input type="Text" name="LeadGen_ContactForm_65636_m0:LastName" class="StandardI AutoFormInput LeadGen_ContactForm_65636_m0_AutoForm" id="LeadGen_ContactForm_65636_m0_LastName" value="" /><div class="fieldclear"></div></td></tr>
    <tr><td> </td><td>Email (we will keep your email completely private)</td></tr>
    <tr><td> </td><td><input type="Text" name="LeadGen_ContactForm_65636_m0:Email" class="StandardI AutoFormInput LeadGen_ContactForm_65636_m0_AutoForm" id="LeadGen_ContactForm_65636_m0_Email" value="" /><div class="fieldclear"></div></td></tr>
    <tr><td> </td><td>Message</td></tr>
    <tr><td> </td><td><textarea type="Text" name="LeadGen_ContactForm_65636_m0:Message" class="StandardI AutoFormInput LeadGen_ContactForm_65636_m0_AutoForm" id="LeadGen_ContactForm_65636_m0_Message"  ></textarea><div class='fieldclear'></div></td></tr>
    <tr><td></td><td><input class='FormSubmitButton' type='submit' name='LeadGen_ContactForm_Submit_LeadGen_ContactForm_65636_m0' value="Submit"></td></tr>
    </table></div>
    
        </form>

     

  • #2 / Jan 17, 2012 7:59pm

    Sean C. Smith

    3818 posts

    Hi skodaminotti,

    I’ve read your post a couple of times and I’m unclear on a couple of things. It seems to me that you are placing the code for your form into a channel entry? Is this correct? While that is technically possible it’s not really the best approach. It would be much better to place your form code directly in the template.

    Also you are using a form script from Hubspot, which is perfectly okay, but why not use forms that are built to be used with ExpressionEngine including the first party offering of Safecracker and the excellent third party FreeForm which also saves your contact emails to the control panel in addition to emailing them to you.

    What field type is the form being submitted to? Does it have any formatting applied to the field type?

    SEan

  • #3 / Jan 18, 2012 3:18pm

    Yes, I am placing the form code directly into a channel entry text area. The text area isn’t the default EE one though, I’m using NSM Tiny MCE.
    So I paste the HTML directly into that entry.

    The Hubspot forms have code that is tied to some tracking with our Hubspot account otherwise I’d use the EE friendly ones.

    I would include the form code in a template, however I have about 6 different forms for 6 different pages that all use the same template layout. This is why I wanted to just add the form HTML into the channel entry.

  • #4 / Jan 24, 2012 8:37pm

    Sean C. Smith

    3818 posts

    Hi,

    When you paste your form code into NSM Tiny MCE are you using source view? If not, it’s possible that the wysiswyg editor will modify the form code resulting in errors.

    Sean

  • #5 / Jan 25, 2012 9:17am

    Yes, I’m using source view when pasting the code.

  • #6 / Jan 30, 2012 7:03pm

    Sean C. Smith

    3818 posts

    skkodaminotti,

    could you create a new field for that channel and use a text area with default text formatting set to “none” and then paste the code in that field and see if it works. Also try putting the code directly into a new template and see if it works there. I would like to see if perhaps the problem lies with the add-on that you are using.

    Sean

  • #7 / Jan 30, 2012 9:12pm

    Hi Sean,

    I actually just added my form code to the template as opposed to pasting it into a channel field.
    I did try a new channel field (w/out the plugin) with no formatting and it did the same thing.
    Gotta love IE 😊

    I achieved what I needed by using the template and a couple if statements.

    Thanks,

    Andy

  • #8 / Feb 02, 2012 8:55pm

    Kevin Smith

    4784 posts

    Good to hear it sounds like you found a solution, Andy. Is there anything else we can help with?

  • #9 / Feb 02, 2012 11:27pm

    I’m good for now 😊 thanks.

  • #10 / Feb 06, 2012 4:07pm

    Shane Eckert

    7174 posts

    Hi Andy,

    I am glad you are all sorted.

    Thank you again for using the ExpressionEngine forums!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases