Move location form handling into head
This commit is contained in:
parent
8f61d2d207
commit
46a665b7d6
|
@ -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()) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue