in reply to CGI From Templates

Here is my initial attempt at a module FormParser. Its crude and ugly and its not an object yet, just a function housed in there. Next I'm working on making it an object (dear god) then i want to add handling for tags. So like a handler can be registered for each tag..

AddHandler("text",&FormText,&DisplayText)

where the first parameter is the tag, the second is a code ref for the form tag, and the third is the code ref for normal display.

I also wanna be able to snag attributes....i.e. have <select options="&listem"> and have the listem function called. It needs to be able to snag all tags of "select" with attribute of "options" and it needs to be passed the HTML entity to add the <option value="">name</option> tags inside.

I guess then each handler should accept a reference to the HTML::Element that it is handeling, and return that reference back.

I'm just kinda feeling out my ideas here as i implement them, for a kinda thought process record, and to get any feed back along the way. Better ways to handle, different ways, draw backs to my current way, etc. Please let me know if this is improper use of PM :-)

Update: Converted Module to class
Thanks,
Eric Hodges

Replies are listed 'Best First'.
Re: Re: CGI From Templates
by eric256 (Parson) on Jul 30, 2003 at 18:01 UTC

    for anyone interested my test modules is here FormTemplate. Against all common sense it is currently used in some of the new forms i am producing for my company

    Currently it supports embeded perl, several unique form types that grab info from another source for selects, some self checking feilds and the ability to display the data in one form, and show it in another. Soon adding the ability to display/enter/edit data in a single form. Step by step.

    ___________
    Eric Hodges