Advancedform_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Mon Oct 10, 2011 9:57 pm

Hi Christoph

Just made a new form using latest beta but all my fields are filled with:
ÂÂÂÂÂ

Any reason?

b

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Mon Oct 10, 2011 10:04 pm

Hi b,

:? To avoid misunderstandings: you've created the form in the form editor and saved it. Everything's ok so far. Now you've called advancedform(...) on a page, you switched to view mode, and got this result?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Mon Oct 10, 2011 10:07 pm

yes

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Mon Oct 10, 2011 10:14 pm

Hi b,

that's really strange. When the form is first shown, all fields should be empty, except those for which a default is defined in the property editor of the field.

But one thing's sure: there's somewhere an encoding mismatch (Latin-1 vs. UTF-8 or so).

Could you please export the form definition, and post it here, or send it to me by PM?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Mon Oct 10, 2011 10:20 pm

Think I have found the problem. The file form.dat seems to have been corrupted. Re-uploaded file from the zip and recreated the form and it is now ok.

If it goes again I send you the form defintion

thanks

b

EDIT : added new fields and its gone again!!!. I'll PM you with the defintion
b

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Thu Oct 13, 2011 7:45 pm

Christoph

Is there a way to go to a different Thank You page depending on how a RadioButton or checkbox has been selected?

B

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Thu Oct 13, 2011 10:51 pm

Hi b,

that seems to be a good idea. And I was just going to answer: yes, that could easily done! But then I realized the real problem. How could this be defined in the form editor? Should I introduce another field type? Should the default "Thanks page" be kept as a fallback, if this field type isn't defined? Should the user be forced to enter a "Thanks page" for all possible values of the radio, or should there be the default of the general form's "Thanks page"?

As I've found out by experimenting, all of this could be done. But what's really needed? Could you please give an example how you would use this feature. That would make it easier for me to implement it reasonably.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Fri Oct 14, 2011 8:55 am

Hi Christoph

On the RadioButton/CheckBox parameters have an extra box where you can insert an optional different Thank you page if the button is True. If the box is empty it would go to a default Thank you page.

I intend to use a feature like this so that a Thank you page could be personalised depending on what was filled in on the form. I intend to have a Buy Now PayPal button on the Thank You page which would go off to a different preset Paypal page depending on what was selected.

B.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Fri Oct 14, 2011 11:35 am

Hi B.,
bca wrote:I intend to use a feature like this so that a Thank you page could be personalised depending on what was filled in on the form
Ah, yes. Indeed that should be possible: a personalised Thanks page! This could even be used to present a page: "Dear sir..."/"Dear madame...". But wait -- what if the user wants to see: "Dear Mr. Becker..." That wouldn't be possible. As I want to keep Advancedform_XH as simple and general as possible, I'm thinking of introducing another hook, something in the line:

Code: Select all

advancedform_custom_thanks_page($form_name, $fields) {
    switch ($fields['gender']) {
        case 'male':
            return 'Thank_you:Mister';
            break;
        case 'female':
            return 'Thank_you:Madame';
            break;
        default:
            return void; // redirects to the default Thanks page
}
 
That would require the user to write some PHP, but it might not be too hard, to adapt this code. But it will even allow:

Code: Select all

advancedform_custom_thanks_page($form_name, $fields) {
    return 'Thank_you&name='.$fields['name'];
}
 
with some script code for the Thanks_page that will insert the value of the query parameter name.

Would that be enough for your needs?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Fri Oct 14, 2011 1:36 pm

Maybe personalise wasnt quite the right word although that would be nice.

I am more looking for going to a different page depending on the selection of a radiobutton/checkbox.
eg If radiobutton1=true go to paymentpage1 OR if radiobutton2=true goto paymentpage2 else go to default Thank you page.

or the paymentpage could be a more information page only available to people who have filled in the form.

Although a "Thank you John" page would be nice its not really what i had in mind

B

Post Reply