Forums

Save Form name to table instead of Form Id

woogygun 20 Dec, 2011
Hi there

Hoping someone can help me here.

Is it possible to store the form name in a table instead of the form id?
GreyHead 20 Dec, 2011
Hi woogygun,

The answer is 'Yes' but I'm not sure what the question is, or rather what you need to do.

Bob
woogygun 20 Dec, 2011
I have multiple copies of the exact same form, just displaying a different thank you message with a download link.

ive created one table for which all these forms will save their data to. This works great so far and collects the form ID's and fields, but i need it to collect the form name so when i do an export i can see which forms were actually used and how many times.
GreyHead 20 Dec, 2011
Hi woogygun,

Try adding a 'form_name' column to your table and then put this code into a Custom action before the DB Save action
<?php
$form->data['form_name'] = $form->form_details->name;
?>


Bob
woogygun 20 Dec, 2011
Hi there Greyhead thanks for the speedy replies and help so far.

im now getting this error

Parse error: syntax error, unexpected ']' in /administrator/components/com_chronoforms/form_actions/custom_code/custom_code.php(18) : eval()'d code on line 2
woogygun 20 Dec, 2011
haha, not to worry, i pretty much figured it out as i hit post. i swapped the ] for a }

thanks again GreyHead
GreyHead 20 Dec, 2011
Hi woogygun ,

Apologies for the typo - it's actually the other way round, the { needs to be repalced with a [.

I've fixed my original post.

Bob
woogygun 20 Dec, 2011
hmm thats strange. it is saving the data with }

should i change it anyways?
GreyHead 20 Dec, 2011
H woodygun,

That's weird - but it if works I guess it's OK.

Bob
This topic is locked and no more replies can be posted.