Page 1 of 1

Customizing Modal box

Posted: 2014-06-20 05:22
by shkdxb
trying to customize the modal box messages, no idea where the error messages are customized.

i want to show a popup message when start date is greater than end date. inserted the below code in file common.js.php under function Tablename_validateData() by
coping one of the existing error message code and pasted and changed the field names, but the popup message is not showing "the start date is greater than end date" as message but shows the copied source error

Code: Select all

if($('Callreceived_date').value >= $('CallResponded_date').value)
	{ modal_window({ message: '<div class="alert alert-danger"><?php echo addslashes($Translation['field not null']); ?></div>', title: "<?php echo addslashes($Translation['error:']); ?> Problem Related", close: function(){ jQuery('#Callreceived_date').focus(); } }); return false; };
how can i customize the message?

Re: Customizing Modal box

Posted: 2014-06-22 03:30
by a.gneady
Try this:

Code: Select all

if($('Callreceived_date').value >= $('CallResponded_date').value)
   { modal_window({ message: '<div class="alert alert-danger">the start date is greater than end date</div>', title: "<?php echo addslashes($Translation['error:']); ?> Problem Related", close: function(){ jQuery('#Callreceived_date').focus(); } }); return false; };

Re: Customizing Modal box

Posted: 2014-06-23 02:53
by shkdxb
this works but
1. the title is still shows as "Problem related". how to change this
2. The focus is not on end date filed after the modal box removed
3. This error shows up whenever i try to save the record, even when the date are correct.

Re: Customizing Modal box

Posted: 2014-06-29 03:21
by shkdxb
anyone help pl.