From 31e293a7362bc34f40ada57fe837e48e8e357856 Mon Sep 17 00:00:00 2001
From: Tim Clark <eclipse@sucs,org>
Date: Mon, 21 Sep 2009 23:24:51 +0000
Subject: [PATCH] fixed some ajax probems and finished modifying the css that
 rc started

---
 htdocs/js/signup.js  | 14 +++++++-------
 templates/signup.tpl | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/htdocs/js/signup.js b/htdocs/js/signup.js
index fa19fa1..c8c9123 100644
--- a/htdocs/js/signup.js
+++ b/htdocs/js/signup.js
@@ -18,7 +18,7 @@ function validate(){
 }
 function processPostcode(){
 		// lookup postcode
-                $.getJSON("signup/ajax",{key: "postcode",value: $('input#postcode').val().replace(/ /g,'')}, function(j){
+                $.getJSON("/signup/ajax",{key: "postcode",value: $('input#postcode').val().replace(/ /g,'')}, function(j){
 			//populate dropdown	
                         var options = '';
                         if (j.length > 1) {
@@ -42,7 +42,7 @@ function processPostcode(){
 }
 
 function lookupSID(setname){
-        $.get("signup/ajax",{key:"sid" ,value: $('input#studentid').val()},function(j){
+        $.get("/signup/ajax",{key:"sid" ,value: $('input#studentid').val()},function(j){
                 arr=j.split(":");
                 key=arr.shift();
                 val=arr.join(":");
@@ -68,7 +68,7 @@ function processSID(){
 }
 
 function processUsername(){
-        $.get("signup/ajax",{key: "username", value: $('input#username').val()},function(j){
+        $.get("/signup/ajax",{key: "username", value: $('input#username').val()},function(j){
                 if (j!="OK") {
                         $('div#usernamemessage').attr("style","color:red; float:right; clear:right;");
 			validation['username']=false;
@@ -83,7 +83,7 @@ function processUsername(){
 }
 
 function processName(type, input){
-        $.get("signup/ajax",{key: type, value: $('input#'+input).val()},function(j){
+        $.get("/signup/ajax",{key: type, value: $('input#'+input).val()},function(j){
                 if (j!="OK") {
                         $('div#'+input+'message').attr("style","color:red; float:right; clear:right;");
 			validation[input]=false;
@@ -101,7 +101,7 @@ function processContact(){
 }
 
 function processAddress(){
-        $.get("signup/ajax",{key: "address", value: $('textarea#address').val()},function(j){
+        $.get("/signup/ajax",{key: "address", value: $('textarea#address').val()},function(j){
                 if (j!="OK") {
                         $('div#addressmessage').attr("style","color:red; float:right; clear:right;");
                         validation['address']=false;
@@ -116,7 +116,7 @@ function processAddress(){
 }
 
 function processEmail(){
-        $.get("signup/ajax",{key: "email", value: $('input#email').val()},function(j){
+        $.get("/signup/ajax",{key: "email", value: $('input#email').val()},function(j){
                 if (j!="OK") {
                         $('div#emailmessage').attr("style","color:red; float:right; clear:right;");
 			validation['email']=false;
@@ -131,7 +131,7 @@ function processEmail(){
 }
 
 function processPhone(){
-        $.get("signup/ajax",{key: "phone", value: $('input#phone').val()},function(j){
+        $.get("/signup/ajax",{key: "phone", value: $('input#phone').val()},function(j){
                 if (j!="OK") {
                         $('div#phonemessage').attr("style","color:red; float:right; clear:right;");
 			validation['phone']=false;
diff --git a/templates/signup.tpl b/templates/signup.tpl
index ba6b5c0..b30ab70 100644
--- a/templates/signup.tpl
+++ b/templates/signup.tpl
@@ -30,18 +30,18 @@
                                 <div class="row" id="studentiddiv">
                                         <label for="studentid">Student Number</label>
                                         <span class="textinput"><input type="text" id="studentid" name="studentid" size="30" {if $mode=='re-form'}value='{$fields.studentid}'{/if} /></span>
-					<div id="studentidmessage"{if $mode=='re-form'}{if isset($errors.studentid)} style="color:red">{$errors.studentid}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="studentidmessage"{if $mode=='re-form'}{if isset($errors.studentid)} style="color:red; float:right; clear:right;">{$errors.studentid}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
                                 </div>
 				{/if}
                                 <div class="row" id="usernamediv">
                                         <label for="username">Username</label>
                                         <span class="textinput"><input type="text" id="username" name="username" size="30" {if $mode=='re-form'}value='{$fields.username}'{/if}/></span>
-					<div id="usernamemessage"{if $mode=='re-form'}{if isset($errors.username)} style="color:red">{$errors.username}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="usernamemessage"{if $mode=='re-form'}{if isset($errors.username)} style="color:red; float:right; clear:right;">{$errors.username}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
                                 </div>
                                 <div class="row" id="realnamediv">
                                         <label for="realname">{if $usertype!=2}Real Name{else}Society Name{/if}</label>
                                         <span class="textinput"><input type="text" id="realname" name="realname" size="30" {if $mode=='re-form'}value='{$fields.realname}'{/if}/></span>
-					<div id="realnamemessage"{if $mode=='re-form'}{if isset($errors.realname)} style="color:red">{$errors.realname}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="realnamemessage"{if $mode=='re-form'}{if isset($errors.realname)} style="color:red; float:right; clear:right;">{$errors.realname}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
                                 </div>
 				{if $usertype!=2}
                                 <div class="row" id="postcodediv" style="display:none">
@@ -56,24 +56,24 @@
                                 <div class="row" id="addressdiv">
                                         <label for="address">{if $usertype==1}Term Time {/if}Address</label>
                                         <span class="textinput"><textarea id="address" name="address" cols="35" rows="4">{if $mode=='re-form'}{$fields.address}{/if}</textarea></span>
-					<div id="addressmessage"{if $mode=='re-form'}{if isset($errors.address)} style="color:red">{$errors.address}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="addressmessage"{if $mode=='re-form'}{if isset($errors.address)} style="color:red; float:right; clear:right;">{$errors.address}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
                                 </div>
 				{else}
 				<div class="row" id="contactdiv">
 					<label for="contact">Contact Name</label>
 					<span class="textinput"><input type="text" id="contact" name="contact" size="30" {if $mode=='re-form'}value='{$fields.contact}'{/if}/></span>
-					<div id="contactmessage"{if $mode=='re-form'}{if isset($errors.contact)} style="color:red">{$errors.contact}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="contactmessage"{if $mode=='re-form'}{if isset($errors.contact)} style="color:red; float:right; clear:right;">{$errors.contact}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
 				</div>
 				{/if}
                                 <div class="row" id="emaildiv">
                                         <label for="email">Email Address</label>
                                         <span class="textinput"><input type="text" id="email" name="email" size="30" {if $mode=='re-form'}value='{$fields.email}'{/if}/></span>
-					<div id="emailmessage"{if $mode=='re-form'}{if isset($errors.email)} style="color:red">{$errors.email}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="emailmessage"{if $mode=='re-form'}{if isset($errors.email)} style="color:red; float:right; clear:right;">{$errors.email}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
                                 </div>
                                 <div class="row" id="phonediv">
                                         <label for="phone">Phone Number</label>
                                         <span class="textinput"><input type="text" id="phone" name="phone" size="30" {if $mode=='re-form'}value='{$fields.phone}'{/if}/></span>
-					<div id="phonemessage"{if $mode=='re-form'}{if isset($errors.phone)} style="color:red">{$errors.phone}{else} style="color:green">OK{/if}{else}>{/if}</div>
+					<div id="phonemessage"{if $mode=='re-form'}{if isset($errors.phone)} style="color:red; float:right; clear:right;">{$errors.phone}{else} style="color:green; float:right; clear:right;">OK{/if}{else}>{/if}</div>
 				</div>
 				{if $overridable}
 				<div class="row" id="overridediv">
-- 
GitLab