tags:

views:

39

answers:

2

For some reason, my code displays correctly in all browsers except IE8.

<form dojoType="dijit.form">'
<ul class="ul_two_col_form">
    <li>
        <label>Name</label>
        <input dojoType="dijit.form.ValidationTextBox" invalidMessage="Name is required." required="true" propercase="true" trim="true" id="contactname" />
        <div dojoType="dijit.Tooltip" connectId="contactname">
            Please enter a name.
        </div>
    </li>
    <li>
        <label>Email</label>
        <input dojoType="dijit.form.ValidationTextBox" invalidMessage="Email is required." regExp="[a-z0-9._%+-]+@[a-z0-9-]+\.[a-z]{2,4}" required="true" trim="true" id="contactemail" />
        <div dojoType="dijit.Tooltip" connectId="contactemail">
            Please enter your email address.
        </div>
    </li> 
    <li>
        <label>Message</label>
        <textarea dojoType="dijit.form.Textarea" id="contactmessage" rows="6"></textarea>
        <div dojoType="dijit.Tooltip" connectId="contactmessage">
            Please enter a message.
        </div>
    </li>
    <li>
        <button dojoType="dijit.form.Button" type="button" onclick="essentials.SendContactUsEmail();">Send your request</button>
    </li>
</ul>
</form>

I also get this error in IE8. "Could not load class 'dijit.form'. Did you spell the name correctly and use a full path, like 'dijit.form.button'? dojo.js

A: 

I removed dojoType="dijit.form" from the form tag and it works.

Benny
+1  A: 

By removing the dojoType attribute from your form element, you've reverted to the generic HTML form. If you want to make use of Dojo Form validation, you can do so with something like this...

You'll need to use: dijit.form.Form

<head>
    <script type="text/javascript">
        dojo.require("dojo.parser");
        dojo.require("dojo.form.Form");
        dojo.require("dojo.form.ValidationTextBox");
        dojo.require("dojo.form.Button");
        // more includes here...
    </script>
</head>
<body>
    <form dojoType="dijit.form.Form" action="..." method="...">
        <input dojoType="dijit.form.ValidationTextBox" trim="true" regExp="..." invalidMessage="Oops...">
        <!-- // more form elemts here... -->
        <button type="submit" dojoType="dijit.form.Button" ...>
            Submit
        </button>
        <script type="dojo/method" event="onSubmit">
            if (!this.validate()) {
                alert("Form contains invalid data.  Please correct....");
                return false;
            }
            return true;
        <script>
    </form>
</body>

Cheers.

S.Jones
I found the problem was there were 2 form elements. The dojo form element was nested inside the other dojo form element that was set on a "master" or root page level. By removing the dojo I removed redundant dojo tags. I also noticed the dojo tag that was there was incorrect too. If it indeed needed to be there, which it didn't, it should have been put as dijit.form.Form...as you stated not as dijit.form.So there was just a whole slew of issues with this dojo form, but we all good now.
Benny
@Benny I see, well it's good that you got it sorted out. Hopefully, the example I posted might be helpful to you or someone else.
S.Jones
@S.Jones -- Yes the post was still very useful for me. Thank you.
Benny