0

Is it possible to change with jquery the value of an input which is embeded in an html list when a node is selected ? I try : php :

echo '<li id="parcelle_'.$parmil_id_now.'" class="checked"><span>'.$list_parcelle[$k]["Nom_parcelle_complet"].'  <input type="text" id="pourcentage_parcelle_'.$parmil_id_now.'" value="'.$pourcentage_traite.'" size="2" maxlength="3"> %</span>';

jQuery :

select: function(event, data) {
   if(data.node.isSelected()) {
       $("#pourcentage_"+data.node.key).attr("value",100);
    } else {
       $("#pourcentage_"+data.node.key).attr("value",0);
    }
},

It works only after reload the tree but we loose the selection... Thank's

GuenLM
  • 13
  • 4

1 Answers1

0

$('pourcentage_parcelle_').val("Street");

try this to set value of text box.

anam
  • 3,905
  • 16
  • 45
  • 85