Move location form handling into head

This commit is contained in:
Erik Michaels-Ober 2011-03-17 12:11:56 -07:00
parent 8f61d2d207
commit 46a665b7d6
2 changed files with 8 additions and 12 deletions

View File

@ -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()) {

View File

@ -19,15 +19,3 @@
</div>
<div id="map_canvas">
</div>
<script type="text/javascript">
$(function() {
$('#location_form').submit(function() {
if($('#address').val() === '') {
$('#address').focus();
$('#address_label').addClass('error', 500);
$('#address').addClass('error', 500);
return false;
}
});
});
</script>