This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Further Date Validation


  1. tmparisi
    Member

    In version 3 there is a checkbox to not let the user select weekends... is there a way to not let the user select a specific week day, such as Monday?

    Posted 12 years ago #
  2. AMurray
    Pro Member

    1) Yes you can disable Weekends. Choose the option, "Disable Weekend Dates"

    2) For disabling a specific day of the week (that is, to choose a check box to disable every Monday, or whatever), I cant see an option for that. You can select specific dates however, (choose them from the calendar pop-up), so effectively using that option you can then go through and choose every Monday occurrence (a bit tedious but it is a work-around). There is no current option to actually choose "every (such and such) week day".

    Posted 12 years ago #
  3. tmparisi
    Member

    I would assume there has to be a way in the PHP to make it happen then. I know there was in v2, i've found those answers on this board. But is the coding and solution the same for v3?

    Posted 12 years ago #
  4. tmparisi
    Member

    Anyone have a PHP solution for this?

    Posted 12 years ago #
  5. tmparisi
    Member

    This is what was added to the post-functions.php file right above line 1367 ($form_unique_ip = $row['form_unique_ip'];).... thanks to MachForm it now works perfect:

    if ($form_id == 2) {
    //date validation
    $date_element_id = 3;

    if (!empty($table_data['element_' . $date_element_id])) {
    if (date("D",strtotime($table_data['element_' . $date_element_id])) == 'Mon') {
    $error_elements[$date_element_id] = 'You unable to select Moday';
    }

    }
    }

    Posted 12 years ago #
  6. verucasalt
    Member

    Is it possible to disable the current date from the calender?

    Posted 12 years ago #

RSS feed for this topic

Reply