[Movecommons-commits] r501 - trunk/src

Mario Gallegos mgallegos at ourproject.org
Wed Jun 6 01:33:16 CEST 2012


Author: mgallegos
Date: 2012-06-06 01:33:16 +0200 (Wed, 06 Jun 2012)
New Revision: 501

Modified:
   trunk/src/mc-dia-form2.css
   trunk/src/mc-dia-form2.js
Log:


Modified: trunk/src/mc-dia-form2.css
===================================================================
--- trunk/src/mc-dia-form2.css	2012-06-05 22:50:16 UTC (rev 500)
+++ trunk/src/mc-dia-form2.css	2012-06-05 23:33:16 UTC (rev 501)
@@ -119,7 +119,7 @@
 
     #first_step label {
         color: #666;
-        font-size: 12px;
+        font-size: 13px;
         font-weight: bold;
         line-height: 14px;
         float: right;

Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js	2012-06-05 22:50:16 UTC (rev 500)
+++ trunk/src/mc-dia-form2.js	2012-06-05 23:33:16 UTC (rev 501)
@@ -565,13 +565,20 @@
         var error = 0;
         fields.each(function(){
             var value = $j(this).val();
-            if( $j.trim(value)=="" || value==field_values[$j(this).attr('id')] ) {
+            if( $j.trim(value)=="" || value==field_values[$j(this).attr('id')] ) {            	
                 $j(this).addClass('error');
-                $j(this).effect("shake", { times:3 }, 50);
-                
+                $j(this).effect("shake", { times:3 }, 50);                
                 error++;
             } else {
-                $j(this).addClass('valid');
+            	if($j(this).attr('id')=='url'){
+            		if(validateURL(value)){
+            			$j(this).addClass('error');
+                        $j(this).effect("shake", { times:3 }, 50);                
+                        error++;
+            		}            			
+            	}
+            	else
+            		$j(this).addClass('valid');
             }
         });        
         
@@ -765,5 +772,10 @@
         	$j(this).trigger('keydown');
         }    	
     });
+    
+    function validateURL(textval) {
+		var urlregex = new RegExp("^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([0-9A-Za-z]+\.)");
+		return urlregex.test(textval);
+	}
 
 });
\ No newline at end of file




More information about the Movecommons-commits mailing list