cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Dynamic Forms
May 9, 2007
3:21 pm
EastonRoyce
Guest

Hi,

Should I be able to register on this forum?

I have a default unchanged installation of cForms installed (4.1). By using the quick tag, I can call the default form with no problem.

How do I call the sample dyanmic form (or call a dynamic form full stop)? Am I supposed to put the code in a page post or do I need to edit a PHP file somewhere? So far all I keep ending up with is a contact page that has code printed on it. I'm following the help page as best I can.

 Any help would be most appreciated.

 

Easton Royce 

May 9, 2007
4:16 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

EastonRoyce,

Yes, to dynamically create a form you'd have to write the necessary PHP code and include it as part of your page or post php template. If you just add the PHP code to your regular post content, then the PHP code as such is shown but not executed.

 

PS: Since I haven't received feedback from anyone using this feature of cform, I'm more than curious as to how you're implementing it :-) 

May 10, 2007
5:00 am
EastonRoyce
Guest

Thanks for your reply! 

ok, no problems. Can you give me an example of some working code, that I would need to place into my PHP files. assuming I still have the default cform, which I do.

Also, to use dynamic forms, do I still need to configure them in the cforms admin page, or is this all done with the code?

Lastly, while I am familiar with PHP, im a beginner when it comes to understanding the workings of Wordpress. How do I choose what page the dyanmic form displays on?

Any or all help would be greatly appreciated!

May 10, 2007
6:55 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

EastonRoyce, all your questions are actually answered on the Help! page as part  of the plugin menu.

There you'll find two examples and the code to include it within your templates as well as a brief descriptions as to why you still need to setup a "proxy" form.

May 10, 2007
8:32 am
EastonRoyce
Guest

Hi and thanks again for your reply. I've been reading and re-reading the help section, but I just can't figure how I am supposed to do this. I'm obviously missing something, and thus haven't caught on yet.

Is it possible that you could give me the steps in order, to make a dynamic form work?

May 10, 2007
8:42 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Provided that you're using your default form (1st form):

  1. Configure all form settings (except the form fields)
  2. open your page.php (or whatever template file)
  3. find a suitable spot for placing the below sample PHP code (see example below): it's got to be within "<?php" &   "?>"
  4. check online

Here is a simple example:

$fields = array();
$fields['label'][0]   ='Your Name|Your Name';
$fields['type'][0]    ='textfield';
$fields['isreq'][0]   ='1';
$fields['isemail'][0] ='0';
$fields['label'][1]   ='Your Email';
$fields['type'][1]    ='textfield';
$fields['isreq'][1]   ='0';
$fields['isemail'][1] ='1';


insert_custom_cform($fields,'');    //call default form

Supported field 'types' are explained in the HELP section, the expect format for the field 'label' (=field names in the admin form config!) are also described there.

I'll check if I overlooked something in the code, as I -admittedly- haven't tested dynamic forms in a while :-) 

May 10, 2007
10:40 am
EastonRoyce
Guest

Awesome! Ok, I'm making some progress and things are clearer for me now. Thanks for the example! It was just what I needed to a kick a long.

How do I choose what page the form appears on? At the moment, following your instructions, it appears on every page. I'm using slug based permalinks. 

May 10, 2007
2:13 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

If you just want the form to show up on one page you need to make a copy of the orig. page template (rename it per WP nomenclature, header!) and select it as the custom template for just that one page when writing your new page.

 

May 12, 2007
2:52 pm
EastonRoyce
Guest

Me again!

I realise this question is beyond the extent of your plugin, but I don't suppose you could provide me some assistance in regards to creating another template file? I tried copying my page.php file, and calling it page-test.php I then copied the cforms code to it, but it doesn't show up as a choosable template in wordpress. I'm not really sure what you mean by "WP nomenclature, header". 

Sorry for the fuss. I know I should be spending some time getting to know the inner workings of Wordpress first, but I would really just like to get your dynamic forms function working. If this works the way I think it will, I believe I will have a wide scale use for it. 

 Easton Royce

May 12, 2007
3:49 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline
May 20, 2007
12:24 pm
EastonRoyce
Guest

Hi Oliver,

Thanks for your tip. I guess I should have checked on Codex first! Been flat out the last week, so sorry for the lack of communication. Will give this a try now and see how it goes.

May 20, 2007
3:50 pm
EastonRoyce
Guest

Hi Oliver,

Thanks for your help! I got a template working and I got the 'Advanced' example to work. So far so good!

In the help section of your plugin it says "real-time manipulation"

Perhaps I am confused, but surly that means there is more to dynamic forms then the inclusion of data pulled from a text file.

Is it possible to have users select an option on a page that changes other options? for example,

A Select box for the users country. When they select their country, another select box underneath changes to contain the states of the country selected in the select box above.

Is this sort of thing possible?

May 20, 2007
6:56 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Sorry for raising your hopes and the confusion, but with real-time I meant at run-time, but before user input.

So technically, what you're looking for could be done using Javascript, but cforms doesn't support interactively changing form fields/content based on user input yet.

May 21, 2007
8:30 am
EastonRoyce
Guest

Oh the humanity!!! Thought I had found the holy grail!! Cry

Not to worry, Oliver. I have learned a lot from this experience and so far, your cforms is still far more powerful then the next best forms solution for WordPress (DagonDesign). I am going to see how best I can now use cforms, and will post some links to my solutions here shortly so you can see it in action.

Thanks again, I am glad to have learned something from all of this!

March 18, 2013
4:48 pm
mgc8
Guest

Oliver said
Sorry for raising your hopes and the confusion, but with real-time I meant at run-time, but before user input.

So technically, what you're looking for could be done using Javascript, but cforms doesn't support interactively changing form fields/content based on user input yet.

Hi, is there any update on this? Or any plans to develop this in the future? Just asking as it's one of the only missing features in your otherwise great plugin.

Thanks,

M.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3741

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5341

Posts: 18708

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)