Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please put this script in a Custom HTML element in your form, amend the form field name accordingly. In this example, it is reading from the field "start_date" and "end_date".Remember to enclose this coding in the <script

Code Block
langjavascript
<script type="text/javascript">

...

Code Block
langjavascript

$('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.");
		return false;
	}else{
		return true;
	}
});

</script>