Aralot (aralot) wrote in changelog,
Aralot
aralot
changelog

[ljcom] r10015: LJINT-387: empty fields and disabled but...

Committer: szhirkov
LJINT-387: empty fields and disabled buttons (Kommersant comments)
U   trunk/templates/Identity/ExternalLogin.tmpl
Modified: trunk/templates/Identity/ExternalLogin.tmpl
===================================================================
--- trunk/templates/Identity/ExternalLogin.tmpl	2011-02-10 09:39:29 UTC (rev 10014)
+++ trunk/templates/Identity/ExternalLogin.tmpl	2011-02-10 09:43:39 UTC (rev 10015)
@@ -2,7 +2,6 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<head>
 <title>Log in</title>
 <TMPL_VAR lj_res_includes>
 </head>
@@ -109,6 +108,22 @@
             $(this).parent('li').addClass("current");
             $("#tab-" + type).show();
         });
+		
+		$('.b-auth-item').each(function() {
+			var tabItem = $(this),
+				submitButton = tabItem.find(':submit'),
+				inputFields = tabItem.find('input:text, input:password, input[type=url]');
+			
+			inputFields
+				.bind('change keyup', function () {
+					if ($.trim($(this).val()) === '') {
+						submitButton.attr('disabled', 'disabled');
+					} else {
+						submitButton.removeAttr('disabled');
+					}
+				})
+				.trigger('keyup');
+		});		
 
         $("form").submit(function(e) {
             var form = $(this);

Tags: aralot, ljcom, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments