Posts: 8
Threads: 1
Joined: May 2009
Reputation:
0
Hey all,
Great script, really impressed and so much potential.
Got a couple of can yous with it though.
1. Can you have a hidden field on the form that automatically populates with the username who is filling in the form?
2. Using above apply a filter so that the user can only see submissions for them?
3. Part of our form also asks for a Town/City, and we will have certain people in that town that will need to see those results, but only for their town, can we do that as well?
Cheers
Brad
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Hey Brad,
Quote:1. Can you have a hidden field on the form that automatically populates with the username who is filling in the form?
Yes, but you'll need to use the Submission Pre-Parser module. This module lets you add custom PHP code to process the incoming info and - pretty much - do whatever the heck you want with it. So in this case, you'd add a rule that just did this:
PHP Code:
<?php
$_POST["my_hidden_field"] = $_POST["username"];
It's pretty much that simple.
Quote:2. Using above apply a filter so that the user can only see submissions for them?
Yes... but I'd like to hear a few more details to confirm we're on the same page, first. If I understand you write, you'd have multiple users (or "clients" in FT terminology). They'd each have a client account set up. They'd be the ones filling in the forms (correct?) [in which case, you'd need to tweak the above example I gave for #1 to pull the account info from sessions - but the principle is the same].
Quote:3. Part of our form also asks for a Town/City, and we will have certain people in that town that will need to see those results, but only for their town, can we do that as well?
Yes (he says tentatively), but again I'd need a few more details. You can set up client accounts to view whatever subset of the information that you want. So you could, for example, set up a View that only shows submissions for a particular user and for a particular town/country. This is no problem - but note that it's NOT dynamic (i.e. you can't create these data subsets on the fly), you'd need to create each account manually that would view the appropriate data.
Man, that sounded clearer in my head. Let me know if I can make it sound any more confusing.
- Ben