Joget DX Preview Release Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Skip to end of metadata
Go to start of metadata

This is a quick script for comparing two dates and ensuring that one is larger than the other.

Type the following script in the Custom HTML element in your form and amend the form field name accordingly. Our example below shows a reading from the fields "start_date" and "end_date".

<script type="text/javascript">
$('form').submit(function(){
	startDate = $("input[name='start_date']").val();
	endDate = $("input[name='end_date']").val();
	if( endDate < startDate ){
		alert("End Date must be larger than the Start Date. Please try again.");
        $.unblockUI();
		return false;
	}else{
		return true;
	}
});

</script>
  • No labels