Ad index: choose language JQuery
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jun 2012 21:40:33 +0000 (23:40 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jun 2012 21:40:33 +0000 (23:40 +0200)
apps/companyfront/modules/ad/templates/indexSuccess.php

index 7289357..dd8734b 100644 (file)
@@ -1,17 +1,26 @@
 <h2><?php echo __('Ads List') ?></h2>
 
-<form action="<?php echo url_for('ad/indexLanguage') ?>" method="post" <?php $formLanguage->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
-  <table>
-    <tbody>
-      <tr>
-        <td><?php echo $formLanguage->renderHiddenFields(false) ?></td>
-        <td><?php echo $formLanguage ?></td>
-        <td><input type="submit" value=<?php echo __('Update') ?> /></td>
-      </tr>
-    </tbody>
-  </table>
+<script type="text/javascript">
+    $(document).ready(function(){
+        $('#languageselect_id').change(function() {
+            $('#chooselanguage').submit();
+        });
+    });
+</script>
+
+<form id="chooselanguage" action="<?php echo url_for('ad/indexLanguage') ?>" method="post" <?php $formLanguage->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
+<table align="right">
+    <tr>
+    <td>
+        <?php echo $formLanguage->renderHiddenFields(false) ?>
+        <?php echo $formLanguage['id']->render(array('class' => 'validate-selection')) ?>
+    </td>
+    <tr>
+</table>
 </form>
 
+
+
 <?php if ($pager->haveToPaginate()): ?>
     <?php include_partial('ad/list', array('ads' => $pager->getResults(), 'userLanguageId' => $userLanguageId, 'page' => $pager->getPage())) ?>
 <?php else: ?>