Changeset 68055 in spip-zone


Ignore:
Timestamp:
Dec 1, 2012, 4:00:08 PM (7 years ago)
Author:
jeannolapin@…
Message:

Associasip Validité XHTML pour le selecteur de destinations comptables

Location:
_plugins_/Associaspip/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/Associaspip/trunk/inc/association_comptabilite.php

    r68047 r68055  
    8383          foreach ($destinations as $destId => $destMontant) { // restitution des listes de selection HTML
    8484                $res .= '<div id="row'.$idIndex.'" class="choix"><ul>'
    85                 . '<li class="editer_id_dest['.$idIndex.']">'
    86                 . '<select name="id_dest['.$idIndex.']" id="id_dest['.$idIndex.']" >'
     85                . '<li>'
     86                . '<select name="id_dest['.$idIndex.']" id="id_dest_'.$idIndex.'" >'
    8787                . preg_replace("/(value='".$destId."')/", '$1 selected="selected"', $options)
    8888                . '</select></li>';
    8989
    9090                if (!$GLOBALS['association_metas']['unique_dest']) {
    91                     $res .= '<li class="editer_montant_dest['.$idIndex.']"><input name="montant_dest['.$idIndex.']" value="'
     91                    $res .= '<li><input name="montant_dest['.$idIndex.']" value="'
    9292                        . association_formater_nombre($destMontant)
    93                         . '" type="text" id="montant_dest['.$idIndex.']" class="number decimal price" /></li>'
     93                        . '" type="text" id="montant_dest_'.$idIndex.'" class="number decimal price" />›'
    9494                        . '<button class="destButton" type="button" onclick="addFormField(); return false;">+</button>';
    9595                    if ($idIndex>1) {
    9696                        $res .= '<button class="destButton" type="button" onclick="removeFormField(\'#row'.$idIndex.'\'); return false;">-</button>';
    97                     }
     97                        }
    9898                }
    99                 $res .= '<ul></div>';
     99                $res .= '</li></ul></div>';
    100100                $idIndex++;
    101101          }
     
    104104              $options[$defaut] = str_replace('<option ', '<option selected="selected" ', $options[$defaut]);
    105105            }
    106             $n = " name='id_dest[1]' id='id_dest[1]'";
     106            $n = " name='id_dest[1]' id='id_dest_1'";
    107107            if ((count($options) == 1)) { // on a une seule destination possible, pas de selecteur
    108108              $res = "<input$n readonly='readonly' value='$id' /> $texte";
    109109            } else  {
    110               $res = "<ul>\n<li class='editer_id_dest[1]'>"
     110              $res = "<ul>\n<li>"
    111111                . "<select$n>" . join("\n", $options) . '</select>'
    112                 . "\n</li><li class='editer_montant_dest[1]'><input name='montant_dest[1]' id='montant_dest[1]'/></li>\n</ul>"
    113                 . $addDestinationButton;
     112                . "\n</li><li><input name='montant_dest[1]' id='montant_dest_1'/>"
     113                . $addDestinationButton.'</li></ul>';
    114114            }
    115115
     
    117117    return $script
    118118      . '<div id="divTxtDestination" class="formulaire_edition_destinations">'
    119       . '<label for="destination">'
     119      . '<label>'
    120120      . _T('asso:destination')
    121121      . '</label>'
  • _plugins_/Associaspip/trunk/javascript/jquery.destinations_form.js

    r67481 r68055  
    11function addFormField() {
    22var id = document.getElementById("idNextDestination").value;
    3 var DestinationSelect = $("#id_dest\\[1\\]").clone().attr("id","id_dest["+id+"]").attr("name","id_dest["+id+"]");
    4 var DestinationList = $("<li class='editer_id_dest["+id+"]'></li>").append(DestinationSelect);
     3var DestinationSelect = $("#id_dest_1").clone().attr("id","id_dest_"+id).attr("name","id_dest["+id+"]");
     4var DestinationList = $("<li></li>").append(DestinationSelect);
    55var newRow = $("<div class='formo' id='row" + id + "'></div>")
    66        .append(DestinationList);
    7 newRow.append($("<ul><li class='editer_montant_dest["+id+"]'><input name='montant_dest["+id+"]' type='text' id='montant_dest["+id+"]' /></li></ul><button type='button' class='destButton' onclick='addFormField(); return false;'>+</button><button type='button' class='destButton' onclick='removeFormField(\"#row" + id + "\"); return false;'>-</button>"));
     7newRow.append($("<ul><li><input name='montant_dest["+id+"]' type='text' id='montant_dest_"+id+"' /><button type='button' class='destButton' onclick='addFormField(); return false;'>+</button><button type='button' class='destButton' onclick='removeFormField(\"#row" + id + "\"); return false;'>-</button></li></ul>"));
    88
    99newRow.appendTo($("#divTxtDestination"));
Note: See TracChangeset for help on using the changeset viewer.