PHP Classes

Display results in form fields?

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Display results in form fields?  >  (Un) Subscribe thread alerts  
Subject:Display results in form fields?
Summary:How can I display form results in my form fields?
Messages:3
Author:Jim Pietrangelo
Date:2009-07-04 00:22:25
Update:2009-07-04 02:39:27
 

  1. Display results in form fields?   Reply   Report abuse  
Picture of Jim Pietrangelo Jim Pietrangelo - 2009-07-04 00:22:25
I'm relatively new to PHP programming and I am trying to create a web application using your form generator and validation class. I have many individual forms that are used to maintain multiple MySQL database tables.

All my forms are self-submitting and work just fine without your class. However, I would like very much to change them to use your class, mostly because of the excellent built-in validation methods.

Each of my form pages handles the entire C-R-U-D procedure, using a switch statement to decide which procedure to implement.

When I READ in a table row, I need the values to display in the form so that they can be edited if necessary. However, I can not figure out how to do that with your class. I've tried adding "VALUE"=>"$someVariable" to the AddInput arrays, but that doesn't seem to work. It was the only thing I could think to do.

I would appreciate some help or advise.

Also, are there any working example scripts other than the test_form.php that you enclose with the class? I would like to see one that interfaces with a database so that I can see exactly where to place my form handler code.

Thanks in advance.

Best,

Jim

  2. Re: Display results in form fields?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-04 00:41:34 - In reply to message 1 from Jim Pietrangelo
You can use the scaffolding plug-in to generate forms integrated with CRUD operations. That plug-in was developed precisely for that purpose. It even provides some AJAX form submission support.

Take a look at the test_scaffolding_input.php example script. You can view it here in action:

meta-language.net/forms-examples.ht ...

There is also a blog article about this plug-in here:

phpclasses.org/blog/package/1/post/ ...

  3. Re: Display results in form fields?   Reply   Report abuse  
Picture of Jim Pietrangelo Jim Pietrangelo - 2009-07-04 02:39:27 - In reply to message 2 from Manuel Lemos
Thank you, Manuel. I'll take a look at those and get back if I have other questions.

Much appreciated.

Jim