• Resolved brozra

    (@brozra)


    On this page there is a “Ship By Date” field but the only validation it can do is to see if it is empty or not.

    Is there a hook / filter that I can tie into to validate the field to make sure that the date entry is valid and also beyond a certain date? I want to make sure that the customers who use this field enter a date that is at least ten (10) working days beyond today’s date.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @brozra,

    Well, you can do this with little Javascript inside your theme/somewhere:

    var future = new Date();
    future.setDate(future.getDate() + 30);
    jQuery("#date_of_arrival" ).datepicker( "option", "minDate", future );
    
    Thread Starter brozra

    (@brozra)

    I had already thought of that and I’d rather have server-side validation. JS validation is pointless if they can just turn off JS and bypass the validation entirely.

    So what I am looking for is a filter or hook (if they exist) that I can tie into to check that particular date field and do custom validation to ensure it is in a date format and also a date on or beyond a calculated date.

    If it doesn’t exist I can come up with something on my own.

    Ok, but for now server-side validation is not possible.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Validation’ is closed to new replies.