pari: trunk r927 - /trunk/config/timerules.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon May 14 20:23:44 MST 2007


Author: pari
Date: Mon May 14 22:23:43 2007
New Revision: 927

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=927
Log:
Checking required fields for Time Rules

Modified:
    trunk/config/timerules.html

Modified: trunk/config/timerules.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/timerules.html?view=diff&rev=927&r1=926&r2=927
==============================================================================
--- trunk/config/timerules.html (original)
+++ trunk/config/timerules.html Mon May 14 22:23:43 2007
@@ -300,7 +300,27 @@
 	}
 }
 
+function check_allfields(){
+	
+	if(!_$('id_rulename').value){
+		alert("Please Enter a Rule Name");
+		_$('id_rulename').focus();
+		return false;
+	}
+
+	var slectboxes = ['startime_hour', 'startime_minute','endtime_hour','endtime_minute','wday_start','wday_end','startdom','enddom','month_start','month_end','dest_match','dest_nomatch'];
+	for (var r=0; r < slectboxes.length; r++){
+		if(!_$(slectboxes[r]).value){
+			alert("Please select a value");
+			_$(slectboxes[r]).focus();
+			return false;
+		}
+	}
+}
+
+
 function save_rule(){
+	if(!check_allfields()){return false;}
 	if(isNewRule){
 		var getnewruleextension = function(){
 			var t=1;
@@ -462,7 +482,7 @@
 	</div>
 	<BR>
 </div>
-<div id="timerule_editdiv" STYLE="display:none; position: absolute; left: 20; top: 20; width:480; height:320; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+<div id="timerule_editdiv" STYLE="display:none; position: absolute; left: 20; top: 40; width:480; height:320; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
 	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'timerule_editdiv');">
 	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">
 		<TD><font color="#FFFFFF">&nbsp;&nbsp;<span id="form_caption"></span></FONT></TD>



More information about the asterisk-gui-commits mailing list