Hi,
i've made a form with chronoforms but now i want to add another field in the table with a default param, how i can do it?
i've made a form with chronoforms but now i want to add another field in the table with a default param, how i can do it?
ok i solved the problem by adding the field in the table with phpmyadmin. But if i need to display the field in the front end with differents color what i must do? i want to display the data with red color if the field is 1 and with green color if the field is 2🙄
Hi vecchia,
how do you show the field in frontend ? show me code
Max
how do you show the field in frontend ? show me code
Max
i add the data in the field with chronoforms and i show them with chronoconnettivity... sorry for my bad english, i don't speak it very well😶
body
i would that if status_mappa is 1 the color is red, if status_mappa is 2 the color is green :?
body
<tr style="font-weight: bold;">
<td>{nome_mappa}</td>
<td>{recordtime}</td>
<td>{status_mappa}</td>
</tr>
i would that if status_mappa is 1 the color is red, if status_mappa is 2 the color is green :?
Hi vecchia,
I think you can do it this way:
Cheers
Max
I think you can do it this way:
<?php
if($MyForm->status_mappa == 1){
$color = '#ff0000';
}
if($MyForm->status_mappa == 2){
$color = '#000000';
}
?>
<tr style="font-weight: bold;">
<td>{nome_mappa}</td>
<td>{recordtime}</td>
<td style="color:<?php echo $color; ?>">{status_mappa}</td>
</tr>
Cheers
Max
mmm, it doesn't works😢 with phpmyadmin i created a new field INT(11) and i put in it the number 1. After that i tried your code but it doesn't write the color in the style😲
does it load the same record data into other fields ?
Max
Max
all the data are displayed but when i try that code it doesn't work... it must write:
but the results is:
style="color: [color]"
but the results is:
style="color: "
the command:
doesn't work... i tried this:
but it doesn't write the result🙄
$MyForm->[field]
doesn't work... i tried this:
<?php echo($MyForm->[field]); ?>
but it doesn't write the result🙄
Oh sorry, a typo, please use my code exactly but replace $MyForm by $MyRow
Max
Max
This topic is locked and no more replies can be posted.