views:

79

answers:

1

I'm trying to use jQuery UI to animate a transition on a form and while the code works correctly in Firefox and Chrome, a Javascript error occures in IE8.

I'm using jquery-ui-1.8.2.custom.min.js and the error given is:

Message: 'end.0' is null or not an object - Line: 819 - Char: 6

My CSS:

.formfield {
    background-color: White;
    border: none;
    padding: 5px;
    width: 90%;
    overflow: hidden;
    margin: 0px;
}

.formfieldselected {
    background-color: MintCream;
    border: none;
    padding: 5px;
    margin: 0px;
    overflow: hidden;
}

Javascript:

$(document).ready(function()
{
$(":input").each(function()
    {
    var myInput = $(this);
    if (this.type == 'submit')
    {
        return;
    }
    myInput.bind('focusin', function()
    {
        $('#' + this.id + 'field').removeAttr('style'); // Reset Style if broken
        $('#' + this.id + 'field').switchClass('formfield', 'formfieldselected', 300);
        $('#' + this.id + 'helpbox').removeClass('helpboxhidden').addClass('helpboxvisible');
    });
    myInput.bind('focusout', function()
    {
        $('#' + this.id + 'field').switchClass('formfieldselected', 'formfield', 300);
        $('#' + this.id + 'helpbox').removeClass('helpboxvisible').addClass('helpboxhidden');
    });
    });
...
}

And finally one of the elements this code is supposed to be working on:

<DIV id="eventnamefield" class="formfield">
    <DIV id="eventnamehelpbox" class="helpboxhidden">
    This name is used throughout the system to refer to this event and is shown to Attendees
    </DIV>
    <label for="eventname" class="adminformlabel">Event Name:</label>
    <br />
    <input type="text" name="eventname" value="" id="eventname" maxlength="50" class="adminforminput"  />
</DIV>
A: 

Found the answer.

Turns out jQuery UI under IE can not handle colours referenced by name. Changing the colours to their hex codes in the CSS fixed the problem.

Nidonocu