load data to value check

greghph 02 Mar, 2017
hi
how can i do to check value in CF passing data from CC?
example: in CC the filed = 1 and i want to check the checkbox in CF
thanks
GreyHead 02 Mar, 2017
Hi greghph,

The ChronoForm should load the form data based on the ID passed from CC - so if you have a 1 saved in the database table that should set the checkbox value to match.

Bob
greghph 02 Mar, 2017
Hi bob
i try this in form custom code but it doesn't work
<input name="chkformato" id="chkformato" value="1" <?php
$checked=articolo[ce];
if ($checked == 1) echo 'checked="checked"'; ?> class="" title="" style="" data-load-state="" data-tooltip="" type="checkbox" />
GreyHead 02 Mar, 2017
Hi greghph ,

You shouldn't need that - please add a Debugger to the end of the form On Load event and copy and paste the output here.

Bob
greghph 03 Mar, 2017
hi bob
here the debug code
thx
Array
(
    [cont] => lists
    [ccname] => articolomodifica
    [act] => edit
    [gcb] => 1118
    [articolo] => Array
        (
            [uniq_id] => 74c6ca383a34d2586bf4804903ba843590df2dcc
            [user_id] => 0
            [created] => 2017-02-08 08:44:00
            [modified] => 2017-03-02 09:59:38
            [cf_id] => 1118
            [codice] => 104001
            [descrizione] => DEDO 2001
            [descrizione1] => 
            [cliente] => 
            [codice_art_cli] => 
            [colore] => NERO/BLACK
            [secondo_colore] => 
            [barcode] => 801916312859
            [wattled] => 35W
            [ip] => IP66
            [fascio] => 
            [ik] => 
            [volt] => 230V
            [lunghezza] => 
            [peso_n] => 0,800
            [peso_l] => 0,986
            [volume] => 0,0071
            [attacco] => G8,5
            [pc] => 1
            [disegno] => dedo200.PCX
            [disegno1] => 
            [classe] => 1
            [infiammabile] => 0
            [ce] => 1
            [imq] => 1
            [enec] => 1
            [ecolight] => 0
            [ksformato] => 1
            [ksartigiano] => 1
            [stato] => 1
        )

    [ART] => Array
        (
            [cf_id] => 1
            [uniq_id] => 
            [codice] => nessuno
            [descrizione] => IVELA
            [created] => 0000-00-00 00:00:00
            [modified] => 
        )

    [ETIC] => Array
        (
            [cf_id] => 1
            [uniq_id] => a6984ba4b45990d7240bb4da6693bec6b38ee639
            [user_id] => 50
            [created] => 2016-12-07 13:22:12
            [modified] => 2017-02-16 16:29:57
            [formato] => 100x75bianca
        )
GreyHead 03 Mar, 2017
Hi greghph,

There is no chkformato variable in the Debugger data - which entry do you want to use to set this checkbox?

Bob
greghph 10 Mar, 2017
Hi Bob
i want this
for example
if [articolo][classe]=1 then in chronoform chkentity=checked else chkentity=unchecked
it's possible?
and then, in the chronoform, when i change the checkbox status, how can i do to update record on DB and chronoconnectivity also?

thanks!!
Max_admin 10 Mar, 2017
Hi greghph,

just name your form field name "articolo[classe]"

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
greghph 15 Mar, 2017
Hi max
it'no true
see the Attachments
where i wrong?
best regards
GreyHead 15 Mar, 2017
Hi greghph,

In your doc you have articolo[ce] but there is no articolo[ce] in the form data array - please try articolo[classe] as Max suggested

Bob

PS you should not use [] in the Field ID as that is illegal HTML - please use something like articolo_classe for the ID
This topic is locked and no more replies can be posted.