<script type="text/javascript">
var alreadyOpened = false;
+ var checkBoxes = 0;
$(document).ready(function(){
$('#ad_longitude').click(function() {
});
});
+ $(document).ready(function(){
+ $('[id$=delete]').change(function(){
+ var checkedBoxes = 0;
+ $('[id$=delete]').each(function(data){
+ if($(this).is(':checked')) {
+ checkedBoxes = checkedBoxes + 1;
+ }
+ });
+ if (checkedBoxes == checkBoxes) {
+ alert('The system always keeps one description for one ad even if you try to remove all of them. \n' +
+ 'If you want to remove completely an ad you may do it from the Ads Index Web Page \n' +
+ 'or just press the Back to list button which you can find on the bottom of this page.');
+ }
+ });
+ });
+
+ $(document).ready(function(){
+ $('[id$=delete]').each(function(data){
+ checkBoxes = checkBoxes + 1;
+ });
+ });
+
</script>
<form action="<?php echo url_for('ad/'.($form->getObject()->isNew() ? 'create' : 'update').'?page='.$page.(!$form->getObject()->isNew() ? '&id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>