Function array2js_form_set
create a js code from an array to set the values dynamically to html from components without recreate the element or replace dynamically complete html components (usable for ajax callbacks, see mvc samples),
sample:
$a = array(
'edt1'=>"Sample", // set the value
'txt1'=>"Hello World", // set the value
'rad1'=>'val2' // select the value,
'chk1[]'=>array('val1', 'val2'), // select the value's
'lst1[]'=>array(1,1,0,0,0),
)
); // fill form values
OR
$a = array(
'pnl1'=>$lnk-html(),
'pnl2'=>$txt-html()
); // fill component panels with HTML (require base64 encoding)
Located at
tools.lib.php
Parameters summary
array |
$a |
|
boolean |
$stringAsBase64 = false |
=> encode the string with base64 |
Return value summary
string
|
string |