This topic is locked

Hierarchical Structures

3/27/2013 3:53:51 AM
PHPRunner General questions
M
mik 62 author

you have never used hierarchical structures in PHP runner?
thank

C
cgphp 3/27/2013

We need more info, try to reformulate your request.

M
mik 62 author 3/27/2013

Cristian thanks for asking, I may be the only one able to resolve this situation

I need something like that go together in a field
father

children1

children2

children3

father 1

children4

children5
ecc.
children should be checked
thank you very much

C
cgphp 3/27/2013

Post your js/php code.

M
mik 62 author 3/27/2013

well Cristian
in Visual Editor (HTML)

<DIV id=cruscopratica></DIV>
this code PHP in Before Display
$nncru = 0;

$pp0 = '';

$strSQLxcp = "select * FROM .............................";

$rstp = db_query($strSQLxcp,$conn);

while($dataCRU = db_fetch_array($rstp)) {

$nncru = $nncru + 1;

$visualizzaCRU=$dataCRU['descrizione'];

$pp0.=' <INPUT id="ib'.$nncru.'" class=button type=checkbox><LABEL>'. $visualizzaCRU.'</LABEL>
';

$pageObject->setProxyValue("var".$nncru, 'ib'.$nncru);

}

$pageObject->setProxyValue("prova", $pp0);
in JavaScript

document.getElementById("cruscopratica").innerHTML = proxy['prova'];
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

var val = $("#"+ proxy['var1'] ).val();

formObj.baseParams['test'] = val;

});
I believe the problem is not in check how many there are, as such value is dependent on a table

the code in JavaScript, of course, does not work properly
thank