Forums

Add a field at the table of chronoforms

vecchia 24 Jun, 2009
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?
vecchia 25 Jun, 2009
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🙄
Max_admin 25 Jun, 2009
Hi vecchia,

how do you show the field in frontend ? show me code

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
vecchia 25 Jun, 2009
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
<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 :?
Max_admin 25 Jun, 2009
Hi vecchia,

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
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
vecchia 26 Jun, 2009
ok and how i can add a compatible field in the chronoforms's table?
vecchia 26 Jun, 2009
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😲
Max_admin 26 Jun, 2009
does it load the same record data into other fields ?

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
vecchia 26 Jun, 2009
all the data are displayed but when i try that code it doesn't work... it must write:
style="color: [color]"

but the results is:
style="color: "
vecchia 26 Jun, 2009
the command:
$MyForm->[field]

doesn't work... i tried this:
<?php echo($MyForm->[field]); ?>

but it doesn't write the result🙄
Max_admin 26 Jun, 2009
Oh sorry, a typo, please use my code exactly but replace $MyForm by $MyRow

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
vecchia 26 Jun, 2009
oh yea! now it works very well😀
This topic is locked and no more replies can be posted.