Forums

Save custom field on table

lifecolor 24 Aug, 2012
Hi, I create a table to save my form data, but I've one custom field that not appear in field list of table. Is it possible to save custom field?

Thanks in advance
Life Color Communication srl
GreyHead 24 Aug, 2012
Hi lifecolor,

Sorry, I don't understand your question :-(

Bob
lifecolor 27 Aug, 2012
I created a form and the data entered is stored in a table.
One of the fields of my form is "Custom Element" and this field will not appear in the attributes of the database table. Why?

The "Custom Element" are not stored?
I also tried to add it by hand when creating the table associated with the form, but the data still are not stored.

How can I fix it?
Thanks again
Life Color Communication srl
GreyHead 27 Aug, 2012
Hi lifecolor,

Provided that your custom element is valid HTML and there is a column name in the database table with the same name then the value should save OK.

Bob
GreyHead 28 Aug, 2012
Hi lifecolor,

I don't understand what you are trying to do here. How does the session variable link to the form?

Bob
lifecolor 29 Aug, 2012
Is assigned a value previously and then shown in the Custom element, as shown in the link under "Registrazione a:"
I can give you admin access in PM, if you want

Thanks Bob
Life Color Communication srl
GreyHead 29 Aug, 2012
Hi Lifecolor,

ChronoForms doesn't automatically read data from the $_SESSION array. You need to re-load it into the $form->data array (where the ChronoForms data is stored). Or use PHP to display the value directly from the $_SESSION setting.

Bob
lifecolor 30 Aug, 2012
But I use PHP to display the value of session:
<?php echo $_SESSION['title']; ?>

But this is not enough to store in the table, right?
Life Color Communication srl
GreyHead 30 Aug, 2012
Hi lifecolor,

No that has no connection to ChronoForms, please see my last post.

Bob
lifecolor 31 Aug, 2012
Hi Bob, ok sorry but, how do I re-load into the $form->data array?
Is there a manual?

But I create a table again and if a put a simple string on custom element like "Hello", the field is not added in the table anyway.

Thanks
Life Color Communication srl
Max_admin 03 Sep, 2012
Hi,

Assuming your table has a column named "X" and you want to store "Hello" in that column, you should add a custom code action and include this code:

<?php
$form->data["X"] = "Hello";


The custom code action should be before the "db save" action.

regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lifecolor 27 Sep, 2012
Hi Max, thanks for your suggest but on my coloumn there are only NULL value.

Can I send you an account in PM?

Thanks again
Life Color Communication srl
This topic is locked and no more replies can be posted.