Forums

Confirmation page: Values of Checkboxes and radio buttons

pat01 09 Oct, 2010
Hi

I have radio buttons and checkboxes in a form and I use the confirmation page plugin.

Now I have two problems:

Problem 1:
If no radio button or no checkbox is selected, the confirmation page looks like this:

Select something: {radio0}
Choose anything: {check1}

There shouldn't be the brackets shown with the name of the form fields in between. Instead, there should be nothing.

If the user clicks on a radio button or into a checkbox, their proper value is shown.

Problem 2:
If the user has selected a radio button and then goes back (using the back button on the confirmation page), the original form shows empty radio buttons. The checkboxes are fine, so are all other form fields = all data is republished except for the radio buttons.

I have updated the files cf_confirmation_page.php and plugin.php (as described here in this post).
Thank you very much!

Regards
Patrick
GreyHead 09 Oct, 2010
Hi pat01,

You can use this code in the OnSubmit Before box to fix the results for un-checked boxes
<?php
$check0 = JRequest::getVar('check0', 'nothing checked', 'post');
JRequest::setVar('check0', $check0);
?>
replace check0 with radio0 or check1 as reequired.

Not sure about the Confirmation page plug-in, I'll take a look when I have a moment.

Bob
pat01 09 Oct, 2010
Hi Bob

Thank you for your fast reply. Unfortunately this does not change anything 😟

After clicking on the submit button, the confirmation page still shows the curly brackets if no radio button or no checkbox was selected.


Regards
Patrick

Edit: I just noticed that Problem 1 goes for the confirmation email as well: if no radio button and no checkbox is selected, the curly brackets with the name of the form fields gets printed into the email (instead of showing nothing).

Edit 2: The solution for the emails is here in this post
pat01 13 Oct, 2010
Hello Bob

Problem 1 is solved:
I did paste your code into the server side validation field, works perfect now!

But I still have the second problem:

Problem 2:
If the user has selected a radio button and then goes back (using the back button on the confirmation page), the original form shows empty radio buttons. The checkboxes are fine, so are all other form fields = all data is republished except for the radio buttons.



Any idea?

Thanks!

Patrick
GreyHead 13 Oct, 2010
Hi Patrick,

I'm glad we got one fixed :-)

Can you post a link to the form so that I can take a look at the radio buttons?

Bob
pat01 13 Oct, 2010
PM sent. :wink:
GreyHead 13 Oct, 2010
Hi Patrick,

. . . but not received. Please will you re-send or email (use the links under my picture).

Bob
pat01 13 Oct, 2010
Strange... the message isn't in my "sent" folder either :-(

Anyway, resent the message by clicking on the mail icon. Hope it works this time...?

Regards
Patrick
GreyHead 13 Oct, 2010
Hi Patrick,

Got it thank you. The immediate problem is the umlauts, if you remove them from the radio button values then it works OK.
<input value="Unsere bestehende Website soll uberarbeitet werden" title="" class="radio" id="radio01" name="radio0" type="radio" />


I'm not sure why, my guess is that they get converted to entities somewhere in the RePublish process and the strings are no longer recogised as matching.

Bob
pat01 13 Oct, 2010
Hi Bob

You are the best! I never did think of these special characters, such as umlauts like ä, ö, ü etc.

I now did replace them with HTML (ü = ü) and it works perfect!

The only thing is, once I re-edit the form using the wizard, CF replaces the HTML-coded umlauts, so I must re-enter the ü again.
But I can live with that :-)

Thank you very much for your great help!

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

VPS & Email Hosting 20% discount
hostinger