action based on form submission

daffy 28 Jun, 2009
A small stumbling block for a novice.

I have a chronoform which users should submit. I can tell by looking at the database if a user has submitted a form.
Now I want to go to a different page if they have submitted than if they have not.
Somthing like in PHP
if($form_was_submitted){ GOTO article 30} else {GOTO article 20} 


It is the 'GOTO' bit that has me fooled. OBviously I can put a link but the user has to click that and I want it to happen without a click.
Perhpas this has to happen with javasript but how and what would the code look like?
All Help very welcome.
--
Dave
Max_admin 28 Jun, 2009
Hi Dave,

in order for a code to run we need an event, whats the event we will use to tell that the user did NOT submit the form ? how do I know this or when will I check it ?

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
daffy 28 Jun, 2009
Yes MAX thanks for your thought I do understand that.
The whole section as I described is triggered by a button onclick event.
But I want then the article selected to go to page 10 or page 20 depending on whether the form has been submitted or not without a another click.
I have greatly simplified it here because the onclick event is followed by checking the database then the process as described.

I have considered having the href url altered by a bit of 'domscripting' but I can't seem to get the database output to affect the javscript for domscripting.
==
Dave
Max_admin 30 Jun, 2009
Hi Dave,

so the form has more than 1 button ? a normal button and a submit button and you want to take some action based on which of them was clicked ? if yes then I suggest using 2 submit buttons with 2 different values and check the post value of the button!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.