Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 02:27:23 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Form module: how can I use a field?  (Read 888 times)
Luckyluke

Offline Offline

Posts: 555



« on: April 15, 2008, 10:58:03 AM »

Hi,

Little question: suppose that I have a form with a field "number". How can I get the field "number" in the feedback page or feedback mail?
I hope that my explanation is clear?  undecided

Regards,
Luc
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7660



WWW
« Reply #1 on: April 15, 2008, 12:10:56 PM »

Hello,

in the feedback mail all fields from the form are included.

if you wanna have the form fields on the thank you page you need to write the code for extracting this informations from the database. Should be realizable with a hidden code page as thank you page. As code simply read the newest entrie in form table.

Matthias
Logged
Luckyluke

Offline Offline

Posts: 555



« Reply #2 on: April 15, 2008, 12:19:50 PM »

Oh, I see. There is no way of making a HTML-page with some text like

Hello [form_name], thank you for buying [number] tickets etc etc....

So I have to write some SQL-code who's fetching the last entry from the database.

Hmm...
I'll take a look.

Luc
Logged
doc
Guest
« Reply #3 on: April 15, 2008, 05:48:26 PM »

Hello,

not pretty sure if this solution works with the form module implemented in WB 2.6.7 (only tested with WB 2.7), but here the steps I am using (WB 2.7):

a) create a new page via Pages Admin and set visibility to hidden (e.g. form_msg.php)
b) add the following code to this code page
Code:
var_dump($_SESSION);
echo (isset($_SESSION['field2'])) ?htmlentities($_SESSION['field2']) :'no field 2 submitted';
c) create a page of type form
d) go to the form settings
e) select the page form_msg from the dropdown field success page (at the very end)
f) submit a form and study the output of the Session variables (search for field2-fieldX)
g) adjust the code shown in b) to fit your needs

Regards Christian
Logged
Luckyluke

Offline Offline

Posts: 555



« Reply #4 on: April 15, 2008, 09:32:22 PM »

Hi,

It doesn't work on WB 2.6.7. I'll get the message "no field 2 submitted".
But on WB 2.7 RC3 I get the answer to my problem. I don't know where the name 'field2' comes from but it works  grin
I will look to get these inputs to the result e-mail and/or the result page.

Thxalot,
Luc
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!