Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Hi if i want to make more custom validation how can i do it? Like.. #658

@pencsi

Description

@pencsi
$('form[data-toggle="validator"]').validator({
	custom: {
		nextpay_d: function($el) {
			var n_d = $('#nextpay_d').val();
			var n_m = $('#nextpay_m').val();
			var n = isWeekend(n_d, n_m);
			if (n == 6 || n == 0){
				return "This date falls on the weekend!";
			}
		},
		followpay_d: function($e2) {
			var date1 = new Date();
			var date2 = new Date();
			var n_d = $('#nextnextpay_d').val();
			var n_m = $('#nextnextpay_m').val();
			date2.setMonth(n_m-1, n_d);
			var n = isWeekend(n_d, n_m);
			if (n == 6 || n == 0){
				return "This date falls on the weekend!";
			}elseif(date2 <= date1){
				return "This date must be higher!";
			}
		}
	}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions