in reply to Automatically generating html form fields from a DBI handle

Is there something that does this already and I just missed it? If so, point me at it and skip the rest. :)

phpmyadmin: It's not in Perl (It's in PHP), but it does do auto creation of form fields based on table structure. Specifically when you click on the 'Insert' tab when working with a table. This would be a good place to start if you don't mind reading a little PHP.

  • Comment on Re: Automatically generating html form fields from a DBI handle

Replies are listed 'Best First'.
Re^2: Automatically generating html form fields from a DBI handle (other scripts)
by Aristotle (Chancellor) on May 03, 2003 at 03:11 UTC
Re: Re: Automatically generating html form fields from a DBI handle
by Your Mother (Archbishop) on May 03, 2003 at 03:36 UTC
    Thanks. Both good approaches but I'm planning on using this in mod_perl (and a plain old CGI here and there for development) to roll into a large web app. I'm after an automatic approach b/c this thing will have a few dozen tables in a couple DBs and I can't bear the thought of changing the interface as the DBs are altered/corrected and mature. I couldn't bear the work load for that matter.

    Oh, on a related note, to everyone who pointed monks toward looking at the Template Toolkit: grazie mille! I had never heard of it and was about to go with Mason but I think I like TT2 better. Really amazing, fast, easy to dive into, powerful... wow.

      Regardless of what environment you plan on using this in, the concept of how the form creation is done can be applied.


      A possible issue with this is: do you want the additional overhead that this approach will create? Or are the additional queries against MySQL not an issue?


      Just a thought.

        Good question. For the development, most everything will behave dynamically, including the DB editing. It will be slower on the browser but easier to make changes and not have to wait around for a few thousand pages to get built just to see if a correction worked. Once the thing is runnining and getting anywhere past alpha and on the high-side of beta, I think it will probably build everything, including form templates, to be served statically or at least directly out of something like a Berkely DB so it's fast but adaptable. We'll see if it even gets that far. :)

        And you make a good point about the approach. I'll dig into those apps Aristotle suggested and see how they handle it. (addition: oh, and I'm not anti-PHP, I'm just looking to keep the whole pie in Perl, as it were).