Bonjour à tous,
Je souhaiterais comme le titre le dit, déplacer le contenu d'un td ver un autre.
Pour l'instant j'ai fais ceci :
HTML :
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 <table class="search"> <tbody> <tr id="search_line"> <tpl:block id="initiator_search"> <td width="100" class="field"> <label for="id_id_third"> <tpl:locale_initiator/> </label> <select id="id_id_third" name="id_third" class="fixed"> <tpl:join> <tpl:block id="initiator_block"><option value="<tpl:value/>" <tpl:block id="initiator_selected">selected</tpl:block>><tpl:name/></option></tpl:block> </tpl:join> </select> </td> </tpl:block> <tpl:block id="contract_search"> <td width="100" class="field"> <label for="id_id_contract" id="contract_field" style="visibility:hidden;"> <tpl:locale_contract/> </label> <select id="id_id_contract" name="id_contract" class="fixed"> <tpl:join> <tpl:block id="contract_block"><option value="<tpl:value/>" <tpl:block id="contract_selected">selected</tpl:block>><tpl:name/></option></tpl:block> </tpl:join> </select> </td> </tpl:block> <td> <label> </label> <INPUT class="button" type="submit" value="<tpl:locale_search/>" name="simple_search"/> </td> <td class="advanced_search"> <tpl:block id="reset_block"> <div class="reset"> <A href="<tpl:reset_url/>"> <tpl:locale_reset/> </A> </div> </tpl:block> </td> </tr> </tbody> </table>
JS:
En fait je cache ma deuxieme cellule si je n'ai pas utilisé mon select, si je choisi une option sur mon select, la j'affiche ma deuxieme cellule qui contiendra un deuxieme select.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 $(document).ready(function() { document.getElementById('contract_field').style.visibility= 'hidden'; document.getElementById('id_id_contract').style.visibility= 'hidden'; $("#id_id_third").change(function() { Show_Contracts(); }); }); function Show_Contracts() { if($('#id_id_third').val() != "") { document.getElementById('contract_field').style.visibility= 'visible'; document.getElementById('id_id_contract').style.visibility= 'visible'; } else { document.getElementById('contract_field').style.visibility= 'hidden'; document.getElementById('id_id_contract').style.visibility= 'hidden'; } }
Mon problème est que si je cache ma deuxieme cellule, mon bouton rechercher reste en 3 eme cellule et donc il y a un trou entre mon select et mon bouton rechercher.
Comment faire pour ne plus avoir ce trou ?
Partager