views:

100

answers:

1

The following code works in IE8, FF, Safari, Chrome etc. (not bothering with IE6 for this one), but doesn't work in IE7. I've been through the code with a fine tooth-comb. Checked the commas, messed around with ; but it's not going anywhere. I'm using the jQuery Validate and Uploadify scripts.

Can anyone see the problem here? Thanks.

    <script type="text/javascript">
        jQuery(document).ready(function($) {

            $("#validateform").validate({
                errorClass: 'invalid',
                rules: {
                    bike_url: {
                        required: true,
                        url: true
                    }
                }   
            })

            $("#uploadify").uploadify({
                'uploader'  : '<?php echo $url . '/wp-content/plugins/biketest/includes/uploadify/uploadify.swf'; ?>',
                'script'    : '<?php echo $url . '/wp-content/plugins/biketest/class/class.uploadify.php'; ?>',
                'folder'    : '<?php echo $url . '/wp-content/plugins/biketest/uploads'; ?>',
                'cancelImg' : '<?php echo $url . '/wp-content/plugins/biketest/includes/uploadify/cancel.png'; ?>',
                'auto'      : true,
                'fileDesc'  : '.jpg or .png files only please.',
                'fileExt'   : '*.jpg;*.jpeg;*.png;',
                'sizeLimit' : '2097152',
                'buttonText': 'Choose Image',
                'scriptData': { 
                    'random': '<?php $rand = rand(0, 999999); echo $rand ?>'
                },
                'onComplete': function(event, queueID, fileObj, response, data) {
                    var image = '<?php echo $rand; ?>-' + ((fileObj.name).toLowerCase()).replace(' ', '');

                    setTimeout(function(){ $(".uploaded").attr('src', '<?php echo $url; ?>/wp-content/plugins/biketest/uploads/s-' + image); }, 500);
                    $("[name=bike_img]").val(image);
                }
            })
        });
    </script>
A: 

you need to add some more '...

like this:

$("#validateform").validate({
                'errorClass': 'invalid',
                'rules': {
                    'bike_url': {
                        'required': 'true',
                       'url': 'true'
                    }
                }   
            })

basically every such key/value should be bewteen ''.

Zayatzz
I added the `'` to the keys, but any value that is `true` or `false` shouldn't have `'` around it.
deadlyhifi
Well, i've always added them everywhere for IE and it makes it work with IE7 I only leave numerical values out of ''
Zayatzz