Forums

How to avoid displaying the form if condition

iplanells 16 May, 2012
Hi,

On my web, I need to show the form only if the user is not logged in. If he is logged, I would like to show the same information as when the user submits it (thank you message).

On the OnLoad I put a custom code to check if the user is already logged, and some other conditions. If these conditions are true, I would like to avoid displaying the form, and go directly to the thank you message.

I've alredy programmed the checking conditions, but I don't know how to avoid to display the form.

Is it possible?

Thanks,
Isabel

PS: Joomla 2.5.4
Chronoforms: 4.0 RC3.3
GreyHead 17 May, 2012
Hi Isabel,

Please use the Authenticator action for this from the Security group.

Bob
iplanells 18 May, 2012
Hi Bob,

thanks for your answer, but I'm still confused. I added the Authenticator, but I still don't know how to solve this:

user logged in?
yes:
user has a card? (I make some database questions to know it)
yes: show the thanks message (it includes name, and card number I get from previous question)
no: show the form with some fields filled (name, email...)
no:
show the empty form.
submit
show the thanks message (it includes name and card number got on submit process)

Thanks in advance,
Isabel
GreyHead 19 May, 2012
Hi Isabella,

If the User fails your tests you can either redirect the user to another page; or use a Show Thanks Message followed by a Show Stopper action.

The easiest way to set up conditional actions is to do your testing in a ServerSide Validation action and trigger the On Fail event by returning False.

If you want something more flexible then you can use my Event Switcher action which allows five different events (four plus the default).

Bob
This topic is locked and no more replies can be posted.