PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5154

Too few examples in QuickForm

Details

Submitted2005-08-19 15:09 UTC
Frommdjones0978-php at yahoo dot com
StatusBogus
PackageHTML_QuickForm
PHP Version5.0.2
OSXP/Linux (both)
Roadmaps(Not assigned)

Comments

[2005-08-19 15:09 UTC] mdjones0978-php at yahoo dot com

Description:
------------
I would love to see more samples in the documentation, and once I figure things out I would be more than happy to post them as comments like you can on the main PHP site.

Code and Template are included below.

Test script:
---------------
$repeat = array();
$repeat[] = $form->addElement('radio', 'repeat', 'none', null, 'none');
$repeat[] = $form->addElement('radio', 'repeat', 'repeat', null, 'repeat');
$repeat[] = $form->addElement('radio', 'repeat', 'repeaton', null, 'reapeaton');

$form->addGroup($repeat, 'repeat', '', '<br />');
$form->addElement('select', 'repeatevery', '', array('Every' => 'Every', 'Every Other' => 'Every Other'));
$form->addElement('select', 'repeateverywhat', '', array('Day' => 'Day', 'Week' => 'Week', 'Month' => 'Month', 'Year' => 'Year',
'MWF' => 'Mon, Wed, Fri', 'TuesThurs' => 'Tue & Thu', 'Weekdays' => 'Mon Thru Fri',
'Weekends' => 'Sat & Sun'));

$enddate = array();
$enddate[] = $form->addElement('radio', 'ends', 'none', null, 'none');
$enddate[] = $form->addElement('radio', 'ends', 'endon', null, 'endon');
$form->addGroup($enddate, 'ends', '', '<br />');

$form->addElement('date', 'enddate', 'Date:', array('format' => 'F d, Y', 'minYear' => date('Y'), 'maxYear' => date('Y')+10, 'addEmptyOption' => true, 'emptyOptionText' => ' '));

Expected result:
----------------
<tr><th colspan="2">{$form.header.showtimes}</th></tr>
<tr>
<td class="label">{$form.newshowtime.label}</td>
<td class="element">{$form.newshowtime.html}</td>
</tr>
<tr>
<TD CLASS='label'>Repeating:</TD>
<TD CLASS='element'>
{$form.repeat.none.html} This event does not repeat
<BR>{$form.repeat.repeat.html} Repeat {$form.repeatevery.html} {$form.repeateverywhat.html}</TD>
</tr>
<tr>
<TD CLASS='label'>End Date:</TD>
<TD CLASS='element'>
{$form.ends.none.html} No End Date
<BR>{$form.ends.endon.html} Repeat until {$form.enddate.html}</TD>
</tr>