A problem with a form : i want a different "onclick" for each "options" (work with input, radio, array...)

By Babeth
Hello everybody, i'm working on a new plugin, but i don't understand something in my form. This is the part witch cause me trouble :

$choix_select = elgg_view('input/radio', array(
      'name' => 'params[choix]',
      'value' => $vars['entity']->choix,
      'options' => array(
          1 => $choix1_label,
          2 => $choix2_label,
          3 => $choix3_label,
          4 => $choix4_label,
          5 => $choix5_label,
          6 => $choix6_label,
          7 => $choix7_label,
          ),

      'onClick' => array (
         1 => 'lechoix1();',
         2 => 'lechoix2();',
         3 => 'lechoix3();',
         4 => 'lechoix4();',
         5 => 'lechoix5();',
         6 => 'lechoix6();',
         7 => 'lechoix7();',
         ),
));
There is the code witch cause me trouble. To be simple : from the begining to "options" group, it works perfectly and get me what i want.
What doesn't work is the "onclick" group. What i want is to associate one "onclick" for one "options", but in reality only the last "onclick" in the array is taking for all my "options".

How can i associate a single onclick to a single option ?
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking