Forums

Re-Validate Entries Before Submitting Form

GoleyC 01 Jul, 2008
I have a form setup, it works great. But I would like to have it so that before a user submits their information, they have a chance to review it before they actually submit it.

The submission would go something like this.
1. User fills out the form.
2. User clicks on submit.
3. User sees a validation page to double check that all fields are correct.
4. User then clicks on the final submit button.
5. User is taking to the re-direct page where they see some text along with what they just submitted.

How does one go about doing this? We already have the form setup to send, and it does redirect to redirect page without problems. We just want to add the extra steps.
GreyHead 01 Jul, 2008
Hi GoleyC,

I did this recently by creating a form where the submit status is checked and either the 'normal' form is shown with a Submit button or a 'confirm' version is shown with all input disabled and Edit and Pay buttons shown.

Please see this thread for more info.

Bob
GoleyC 01 Jul, 2008
Is there a sample form where it shows where to put all these code snippets? I'm not sure where they would all go.

Also, is there a way to show their values after they submit the final form on the confirmation page?
GreyHead 01 Jul, 2008
Hi GoleyC,

No there is no example that I know of. I have a form that does it but it's too complicated to usefully post here (it has an expand field block in it too).

You can show a final confirmation by creating a Thank You page with the variable data in it.

Bob
GoleyC 01 Jul, 2008
GreyHead wrote:

You can show a final confirmation by creating a Thank You page with the variable data in it.

What fields would one use to show this data on the redirect confirmation page?

I've tried using the "elements titles", but that isn't working.

What is the correct syntax to pull the data so that it can be displayed on the confirmation page?

FYI: I'm using Joomla 1.5 with the beta ChronoForms.

I'm still trying to get a grip on the validate stuff, as I'm not sure where to put the following:

Is this correct that I put this in the "On Submit code - before sending email:" field?
// Check if the form is editable or not  
$readonly = ""; 
$edit = true; 
if ( $result_array['submit'] && $result_array['submit'] == "Confirm" ) { 
    $edit = false; 
    $readonly = "readonly='readonly'"; 
} and then this final part
Secondly, I've copied this code you provided in the other thread[code]
if ( $edit ) {
?>
<div>
<input type="submit" name="submit" value="Submit" >
</div>
<?php
} else {
?>
<div>
<input type="submit" name="submit" value="Pay" >
GreyHead 02 Jul, 2008
Hi GoleyC,

I just typed a long answer to this and it seems to have not been saved so I'll try and reconstruct it.

First off don't use a Redirect page if you want to include form data, put the code into one of the OnSubmit boxes in ChronoForms instead - see the FAQs for more info on that.

The problem with the code you inserted is that the opening and closing php tags are missing{code]<?php . . .?>{/code]

To show values when you reshow a form you have to set the field value
<input. . . value="<?php echo $_POST['field_name']; ?>" />
. This format will work for text fields and, slightly adjusted, for textarea fields. You need more complex code to work with checkboxes and radio buttons.

If you are not reasonably comfortable with PHP then you may be better off getting someone else to code this for you. Keeping the form data in place through the various form displays isn't difficult but it's not 'falling off a log' easy either.

Bob

PS 'Element titles' only affects the display of the default tabular results email.
This topic is locked and no more replies can be posted.