Posts: 11
Threads: 1
Joined: Dec 2010
Reputation:
0
Dec 9th, 2010, 1:32 AM
First of all I would like to say FormTools is an excellent tool, have been using it over a year now.
I was wondering is it possible to set a quota restriction on the form? Say if the quota exceeds the limit it will trigger a different auto-reply email?
This is extremely useful when I use it as event registration form.
Regards,
Jackson Chan
Posts: 11
Threads: 1
Joined: Dec 2010
Reputation:
0
Dear Ben,
Wow! Thank you so much for your reply.
Yes I did take a look at the Submission Pre-Parser, but I didn't know you can do SQL query in there too. I thought it's only for form data processing.
Your solution will definitely work, if I know how to put SQL query in the PHP code. Would you please give me a place to look for samples?
Thank you so much.
Regards,
Jackson
Posts: 11
Threads: 1
Joined: Dec 2010
Reputation:
0
Dear Ben,
Another question, yes I understand we can set email triggers based on different views. But is there any way to "play" with the redirected page? (Thank you page), possible to redirects to different return message?
Regards,
Jackson
Posts: 11
Threads: 1
Joined: Dec 2010
Reputation:
0
I'm still wondering how to "find out how many submissions have added so far", is there a var I can get this value?
Thanks!
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Dec 18th, 2010, 10:13 AM
(This post was last modified: Dec 18th, 2010, 10:14 AM by Ben.)
Hey Jackson,
(Dec 13th, 2010, 7:31 PM)jacksonc@ust.hk Wrote: I'm still wondering how to "find out how many submissions have added so far", is there a var I can get this value?
Sure! There's actually a handy Form Tools Core function for this. You can call it in either of these ways:
PHP Code:
<?php
$num_submissions = ft_get_submission_count($form_id);
$num_view_submissions = ft_get_submission_count($form_id, $view_id);
The first way returns the number of submissions in the form - the second, the number of submissions in a form View.
In both cases, you'll need to pass the specific form ID and form View ID that you're interested in. You can use this core right in the Submission Pre-Parser rule.
Quote:is there any way to "play" with the redirected page? (Thank you page), possible to redirects to different return message?
Excellent question. Yes! There's a couple of ways. If you have a POST form, you can always include a hidden field:
Code:
<input type="hidden" name="form_tools_redirect_url" value="http://www.whatever.com" />
If that value is defined, the form will redirect to that URL and not the "redirect URL" value stored for the form. Basically it just lets you override the default value.
Simililarly, you can also set that value in your Submission Pre-Parser rule to dynamically determine the redirect URL:
PHP Code:
<?php
$_POST["form_tools_redirect_url"] = "http://whatever.com";
To be perfectly honest, I haven't tried this in a while - but that was how I originally coded it and I don't think anything's changed.
Anyway, let me know if you have any problems with the above or have any other questions!
- Ben