Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Speaking about the theory of this I was thinking about making a script that does something like:

Foreach field of the table fetch the field name, data type and length. Then generate the html tag according to this information.

I think this is quite easy to do.

As I say, it does sound like a solvable problem, this is the central premise behind Class::DBI::AsForm.

But this supposition breaks down quite quickly when developing applications for the typical (read:awkward) client. How can portability be maintained across DB servers? What about business-specific requirements for form fields such as something as simple as them wanting a <select> where a text input is implied by the schema.

Often you'll have a couple of TEXT fields, one of which they want to be really large for some reason. In a drunker moment I once set about hacking AsForm to read existing entries in TEXT fields and try to assign appropriate rows and cols attributes based on existing entries (!).

Look at how Maypole gets on going down this route: for all the hype about not having to type out your column names even the simplest application will require you to type them out three times to get anything resembling professionalism (to define the headings the user sees, the untaint rules, the relationships etc.)

The consensus seems to be what I feared but have always ended up with in the past - it's still less work and more maintainable just to make the things yourself and get on with something else ;)


MB

In reply to Re^2: Form generation by matthewb
in thread Form generation by matthewb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found