QuickForm custom element

From: Date: Fri, 16 Jan 2004 16:59:34 +0000
Subject: QuickForm custom element
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10189@lists.php.net to get a copy of this message
I wrote a small class that enables you to "attach files" stored on server to your form using a popup dialog. Please see it at http://alrashid.klokan.sk/insFile/ (I'm sorry but for instance only ie6 and mozilla/gecko are tested, i will try to support opera too) Click on Submit button to see how entered data are returned. Note that 3 visible form elements (2x input text for file url and caption, 1x textarea for comment) are generated for demonstration purposes. They should be probably replaced by regular text and their respective values should be stored in <input type="hidden"> elements. Now I'd like to integrate this into quick form as custom element. Would it make sense to derive a new class from HTML_QuickForm_group since it is actually a group of 3 basic elements (url, caption and comment), but as they are generated on client side QF will not know anything about them. Or should I extend the HTML_QuickForm_element class and override all corresponding methods, namely exportValue(); setValue(); getValue(); _prepareValue(); _findValue(); and define toHtml() method that will return raw html for all elements + js code setOptions() for setting insertfile dialog properties ? Thanks Al

« previous php.pear.general (#10189) next »