Topic RSS
Related Topics
10:28 am
Hi,
Sorry if I am being stupid, but any pointers would be appreciated.
I have have a multi-part form, but I want to be able to trigger the email and thanks on the first form when needed.
The first part is basic contact details, and I want to ask the user if they
a) want a call back (in which case, trigger email and thanks)
or
b) want to get into specifics (in which case, go to a longer 2nd form, which then sends the email instead)
I have found how to change the 'next form' in my_functions, with something like (messy code since I had to work out how to get to the 'info' tickbox):
$arr= $_SESSION['cforms']['cf_form5'];
$todofieldname = $arr['$$$todo'];
$todo = $arr[$todofieldname];
if ($todo=="info") {
#change which form comes next
return 4;
}
The problem with that is, it relies the user then submitting form '4', to send the enquiry.
I have a feeling I am going about this the wrong way; all I'd really like, is to trigger an email and redirect if a radio button is selected…. Should I be looking at ajax, and trying to pass something to 'cforms_submitcomment'? Help?
:)
1:10 pm
So, this is probably the wrong way to do this, but what I did was:
1) made a custom wordpress template for the form handling, and created a new page using this template.
e.g. permalink "/next/"
2) created a 'starter' form with admin email disabled, custom field IDs and custom form action set to the page from 1)
e.g. "/next/"
3) The custom 'next' page template had some php to look at the data from the first form
e.g. $todo = $_REQUEST['todo'];
then conditionally, either included secondary forms:
e.g. if ($todo == 'info') insert_cform("info-form");
…or sent an email (not as pretty as cforms own version, unfortunately).
The secondary forms were standard one-page forms and so could use ajax etc.
Most Users Ever Online: 959
Currently Online:
77 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3550
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5158
Posts: 18389
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote










