Forums

Confirmation Plugin with ChronoForms in Module

piotr_cz 29 Oct, 2009
hi,
I'm using ChronoForms 3.1RC5.5 with updated version of Confirmation Page plugin Re: HELP! Confirmation page...again...with RC5.3!.

When using ChronoFroms in content area, Confirmation Page Plugin works fine. However when I use ChronoForms in the module area, after clicking on the Submit button in the Confirmation Page instead of showing blank page/ being redirected to Redirect URL/ showing rendered On Submit code, the pre-filled form is showing again in the content area.

the URI assigned to the form action in the Module body is index.php?option=com_chronocontact&task=send&chronoformname=booking&Itemid=1

the URI assigned to the form action in the Confirmation Page is index.php?option=com_chronocontact&task=beforeshow&chronoformname=booking&Itemid=1

Am I doing something wrong?
help🙂

UPDATE:
seems like the problem is that on the same page there are 2 forms (maybe as with the same name): original in the module and confirmation copy in the content area.

I'm getting the original form in the content area after hitting submit on Confirmation page as a result of some error (CF doesn't show anything in debug mode). If I'll get anything from the apache error.log I'll post it here.

UPDATE2:
there is nothing in the error.log

however my theory about 2 conflicting forms in the page is probably correct. Everything works fine if I:
1) fill in the original form
2) disable CF module in Joomla admin
3) hit submit on original form
4) confirmation page shows up (with no original form in the page)
5) hit submit on confirmation page
6) I get debug ok, and On Submit text.
obisi7 30 Oct, 2009
Bob et al. Can you please get me started with using the confirmation plugin? I have no idea what to enter into the body of the screen that asks for code. Am I correct to think that the confirmation page is where the form data entered will be displayed for review and/or edit before a final submission? Also, this is different from the Thank You page that displays after the form is submitted.

In that case, I have no idea what code to enter on the confirmation page to get the desired results of data review before submission. If there is a thread that will teach me on how to do this, please advise.

Finally, the Thank You page; is this to be displayed via the redirect URL, which is what I currently have?

Thx.
GreyHead 30 Oct, 2009
Hi obisi7,

The Thank you page is shown after the form is submitted, emails sent and data saved, etc. You can do it with a ReDirect URL, or by entering HTML+PHP in either or both of the OnSubmit boxes.

The Confirmation page is shown after the form is submitted but *before* emails are sent, data saved, etc. The idea is that you give the user a chance to verify their data before it is submitted. They can then either confirm the entry or go back and re-edit it.

IIRC the syntax is the same as an Email template i.e. PHP + HTML + the {field_name} syntax.

Bob
piotr_cz 30 Oct, 2009
hey obisi7,
- Confirmation Page is used to review the from and to re-edit it or finally submit.
- Thank you is shown after the form is submitted. You can use a code (via On Submit code) or redirect it to an existing Joomla page (redirect URL).

In confirmation plugin there's tab 'help' with instruction how to use.
If you have form with
<input style="text" name="first_name" />
then in confirmation page code use something like
<p>First name: {first_name}</p>
piotr_cz 30 Oct, 2009
back to my issue, I'm still at the starting point😟

I've tried converting all the fields in my form to arrays (i.e. <input name="first_name[]" />) so those 2 forms with same names don't interfere and then converting posted data back in chronocontact.php to regular 1-dimensional array similar to standard output so CF can work with that.

I stored it back using JRequest::set( $newposted, 'post', JREQUEST_ALLOWRAW, true ) and I've been able to pass all errors (i.e. There is no form with this name...) but after hitting submit on the confirmation page I'm still being redirected back to the form, not to thank you😟

Debug shows no errors..
piotr_cz 03 Nov, 2009
my workaround before it's fixed (didn't test extensively):

1) in your /templates/__template_name_/index.php disable rendering Chronoforms module for the page which goes after confirmation page (for thank you page) to avoid executing Chronoforms twice (that was main problem). Code is for your module in position 'left' and style 'sideslide':

<?php $uri =& JFactory::getURI(); ?>
<?php if ( ($uri->getVar('task') != 'beforeshow' ) && ($this->countModules('left')) ) : ?>
	<div id="left">
		<jdoc:include type="modules" name="left" style="sideslide" />
	</div>
<?php endif; ?>


2) run onsubmit code after 'confirm' button is hit (instead of checking $session->get('chrono_next_step', '', md5('chrono')); ) :
/components/com_chronocontact/plugins/cf_confirmation_page.php at line 173:
		if ( $chrono_next_step == 'confirm' ) {

to
		if (array_key_exists('confirm', $_POST)) {


line 333 should be just like in the updated version of the Confirmation plugin:
            	<input type="submit" name="confirm" value="<?php echo $params->get('submit_button_value', 'Submit'); ?>"/>


any questions, further remarks, directions, etc are very welcome.
Piotr_cz
This topic is locked and no more replies can be posted.