cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




Auto filled out form fields...

Add a New Topic Reply to Post
Post

William Harris - Guest

9:36 pm - July 25, 2007

Is there a way to submit values to a cforms form so that they show
up in fields?

For instance, say you have a real
estate website and your posts are the houses you are listing

and each
listing has a button in the post (thats says make an offer) that will
send you to the cforms contact with the information about that house
(its address, the price that is being asked for the house, etc.)
already inputed into the form for you and then you just fill out the
rest of the information (your name, conctact info etc.)

 if not im asking for it ;)

Oliver - Admin

9:46 pm - July 25, 2007

posts 3899

Yes, it's described in the "dynamic forms" section of the help page.

What this allows you to do, is dynamically (in real-time) build a form and use any form configuration (the ones you already setup) to determine admin email, whether or not the visitor gets a confirmation email etc.

William Harris - Guest

10:58 pm - July 25, 2007

so for my example would I need to call the function that uses the dynamic form in a post with the php excute plugin?

Oliver - Admin

11:20 pm - July 25, 2007

posts 3899

Sorry I missed the 'post' part. Executing PHP within a page is easy, since you can create individual page templates and add code wherever you want to. In posts, this can be a bit more tricky:

Either try the Inline PHP plugin that support PHP function calls from within a post, or modify your index.php / single.php theme templates to meet your requirements (eg. include the form at the end of a post).

Note: However, if you have multiple posts on a page and each owns a form, you need to make sure that every dynamically created form has a unique, corresponding form definition (in cforms admin pages). Multiple dynamic forms on the same page are not allowed to reference the same form 'template' created in the admin UI. Hope this makes sense.

My recommendation: If dynamic forms in posts are required, have the form only show up in the single view (visitor must click on the post). Then you only need to edit single.php to do what you want it to and you can get away with using just one form definition (since you'll only be showing one form at a time).

A bit cryptic, but I hope this makes sense. 

 

Add a New Topic Reply to Post


Reply to Topic: Auto filled out form fields...
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 7 + 11        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.3 (Build 356)