From b83d6366985b5d3792cc544b8c68e8066ba17059 Mon Sep 17 00:00:00 2001 From: Chris Jones <rollercow@sucs.org> Date: Mon, 21 Sep 2009 20:08:49 +0000 Subject: [PATCH] Adds some basic style to the validation feedback so its useable --- htdocs/js/signup.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/js/signup.js b/htdocs/js/signup.js index 5f78424..fa19fa1 100644 --- a/htdocs/js/signup.js +++ b/htdocs/js/signup.js @@ -33,7 +33,7 @@ function processPostcode(){ if (j.length == 1) { $('div#addseldiv').attr("style","display:none"); $("textarea#address").val(j[0].replace(/, /g,'\n')) - $('div#addressmessage').attr("style","color:green"); + $('div#addressmessage').attr("style","color:green; float:right; clear:right;"); $('div#addressmessage').html("OK"); validation["address"]=true; validate(); @@ -49,14 +49,14 @@ function lookupSID(setname){ if(key=="OK"){ if(setname=true) $("input#realname").val(val); - $('div#studentidmessage').attr("style","color:green"); + $('div#studentidmessage').attr("style","color:green; float:right; clear:right;"); $('div#studentidmessage').html(key); validation['studentid']=true; processName("realname","realname"); } else{ - $('div#studentidmessage').attr("style","color:red"); + $('div#studentidmessage').attr("style","color:red; float:right; clear:right;"); $('div#studentidmessage').html(val); validation['email']=false; validate(); @@ -70,11 +70,11 @@ function processSID(){ function processUsername(){ $.get("signup/ajax",{key: "username", value: $('input#username').val()},function(j){ if (j!="OK") { - $('div#usernamemessage').attr("style","color:red"); + $('div#usernamemessage').attr("style","color:red; float:right; clear:right;"); validation['username']=false; } else{ - $('div#usernamemessage').attr("style","color:green"); + $('div#usernamemessage').attr("style","color:green; float:right; clear:right;"); validation['username']=true; } $('div#usernamemessage').html(j); @@ -85,11 +85,11 @@ function processUsername(){ function processName(type, input){ $.get("signup/ajax",{key: type, value: $('input#'+input).val()},function(j){ if (j!="OK") { - $('div#'+input+'message').attr("style","color:red"); + $('div#'+input+'message').attr("style","color:red; float:right; clear:right;"); validation[input]=false; } else{ - $('div#'+input+'message').attr("style","color:green"); + $('div#'+input+'message').attr("style","color:green; float:right; clear:right;"); validation[input]=true; } $('div#'+input+'message').html(j); @@ -103,11 +103,11 @@ function processContact(){ function processAddress(){ $.get("signup/ajax",{key: "address", value: $('textarea#address').val()},function(j){ if (j!="OK") { - $('div#addressmessage').attr("style","color:red"); + $('div#addressmessage').attr("style","color:red; float:right; clear:right;"); validation['address']=false; } else{ - $('div#addressmessage').attr("style","color:green"); + $('div#addressmessage').attr("style","color:green; float:right; clear:right;"); validation['address']=true; } $('div#addressmessage').html(j); @@ -118,11 +118,11 @@ function processAddress(){ function processEmail(){ $.get("signup/ajax",{key: "email", value: $('input#email').val()},function(j){ if (j!="OK") { - $('div#emailmessage').attr("style","color:red"); + $('div#emailmessage').attr("style","color:red; float:right; clear:right;"); validation['email']=false; } else{ - $('div#emailmessage').attr("style","color:green"); + $('div#emailmessage').attr("style","color:green; float:right; clear:right;"); validation['email']=true; } $('div#emailmessage').html(j); @@ -133,11 +133,11 @@ function processEmail(){ function processPhone(){ $.get("signup/ajax",{key: "phone", value: $('input#phone').val()},function(j){ if (j!="OK") { - $('div#phonemessage').attr("style","color:red"); + $('div#phonemessage').attr("style","color:red; float:right; clear:right;"); validation['phone']=false; } else{ - $('div#phonemessage').attr("style","color:green"); + $('div#phonemessage').attr("style","color:green; float:right; clear:right;"); validation['phone']=true; } $('div#phonemessage').html(j); @@ -199,7 +199,7 @@ $(function(){ //populate the address box when an address is selected $("select#addsel").change(function(){ $("textarea#address").val($('select#addsel').val().replace(/, /g,'\n')); - $('div#addressmessage').attr("style","color:green"); + $('div#addressmessage').attr("style","color:green; float:right; clear:right;"); $('div#addressmessage').html("OK"); validation['address']=true; }) -- GitLab