3

I have a simple form that uses the jQuery Tools Dateinput and the jQuery Validation Plugin. The problem is that the validation works in IE and FF but not Chrome or Safari.

HTML:

<form id="testform" method="post">
    <label for="deliverydate">Select delivery date<span class="req">*</span></label>
    <input type="text" class="date required" id="deliverydate" name="deliverydate" />
    <input type="submit" value="submit" />
</form>

jQuery:

$(document).ready(function() {
    $("input.date").dateinput({
        format: 'dd / mm / yyyy',
        trigger: true,
        min: -1
    });

    $("input.date").change(function() {
        alert($(this).val());
    });

    $("#testform").validate();
});

I have a jsFiddle link here with an example.

Any ideas what could be causing this? It's driving me crazy!!

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
areid
  • 283
  • 2
  • 5
  • 14
  • What is the error? I just tried your jsfiddle link in chrome and FF9 and couldn't see any difference. - Edit, scrap that, I'd not clicked the submit button, it errored for me when I selected 31/1/2012 and submitted.. – Stephen Jan 11 '12 at 11:25

1 Answers1

0

When ever I have a problem with specific browsers, adding Modernizer (http://www.modernizr.com/download/) always seem to do the trick!

Stian
  • 1,261
  • 2
  • 19
  • 38
  • I'm not sure Modernizer is useful in this particular problem as I'm not looking for a specific feature that the browser supports but thanks for the suggestion. – areid Jan 11 '12 at 11:33