From 46a665b7d60ae0b50affdb21dadd26b0019bbb6a Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Thu, 17 Mar 2011 12:11:56 -0700 Subject: [PATCH] Move location form handling into head --- app/views/layouts/application.html.erb | 8 ++++++++ app/views/main/index.html.erb | 12 ------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1a4c6fd..b990c40 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -65,6 +65,14 @@ color = '/images/markers/<%= hydrant.user_id ? "green" : "red" %>.png'; addMarker(<%= hydrant.id %>, point, color); <% end %> + $('#location_form').submit(function() { + if($('#address').val() === '') { + $('#address').focus(); + $('#address_label').addClass('error', 500); + $('#address').addClass('error', 500); + return false; + } + }); $('#combo_form input[type="radio"]').live('click', function() { var self = $(this); if('new' == self.val()) { diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index a603486..59b81c0 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -19,15 +19,3 @@
-