<p>I'm currently playing around with <a href="http://pear.php.net/package/HTML_QuickForm" rel="noreferrer">HTML_QuickForm</a> for generating forms in PHP.  It seems kind of limited in that it's hard to insert my own javascript or customizing the display and grouping of certain elements.</p>

<p>Are there any alternatives to QuickForm that might provide more flexibility?</p>

If you find it hard to insert Javascript into the form elements, consider using a JavaScript framework such as
Prototype
or
jQuery
. There, you can centralize the task of injecting event handling into form controls.
By that, I mean that you won't need to insert event handlers into the HTML form code. Instead, you register those events from somewhere else. For example, in Prototype you would be able to write something like this:
```
```
$('myFormControl').observe('click', myClickFunction)
```
```
Also have a look at the answers to
another question
.
/EDIT: of course, you can also insert custom attributes and thus event handlers into the form elements using HTML_QuickForm. However, the above way is superior.