Count Entries
Posted: 20 June 2008 10:54 AM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2008-06-20

I am new to Freeform and so far so good, I was wondering if some one could help me.  I have a form running collecting name in a database, when I reach a certain number of entries, I want the redirect the visitors to a all full page.

Profile
 
 
Posted: 20 June 2008 12:47 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

mbrown8627,

Could you go a little more detail in what you’d like Freeform to do? smile

 Signature 
Profile
 
 
Posted: 20 June 2008 01:55 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  3
Joined  2008-06-20

I have a form that is collecting names for a raffle, the first 25 to register get the tickets.  So after the 25th person I would like a page to come up saying that the raffle is over.

Profile
 
 
Posted: 23 June 2008 08:13 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

Alright… I don’t think this is really possible, but I’ve sort of come up with a start of a workaround smile

You could do this with either a link or have the link generate a Javascript link that will “hide/show” the form/results on the same page.

{exp:freeform:entries form_name="whatever" limit="30"}
{if total_entries 
"25"}
Click here to register
.
{/if}
{if total_entries 
>= "25"}
Raffle is over
click here to view the results.
{/if}
{
/exp:freeform:entries}

The only issue is that it’ll show the amount of times there is entries.
You could probably get around this with PHP though smile
I’m also not great with PHP either, so here’s something to start with… if it works, it works LOL

{exp:freeform:entries form_name="whatever" limit="30"}
{if total_entries 
"25"}
<?php $ff_register 
"Click here to register.";?>
{
/if}
{if total_entries 
>= "25"}
<?php $ff_over 
"Raffle is over, click here to view the results.";?>
{
/if}
{
/exp:freeform:entries}

<?php 
echo $ff_register ?>
<?php 
echo $ff_over ?>

 Signature 
Profile
 
 
Posted: 24 June 2008 12:32 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  3
Joined  2008-06-20

thanks I will try it and let you know.

Profile