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 #672

Forms tag incorrect and missing a bracket

Details

Submitted2004-02-03 04:51 UTC
Fromddalton at shortbus dot net
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.4
OSWindows
Roadmaps(Not assigned)

Comments

[2004-02-03 04:51 UTC] ddalton at shortbus dot net

Description:
------------
Using the code below, the quick form generates a form tag missing a bracket :

<form action="index.php?caseid=connect" method="post" name="connect" id="connect"
<input name="ttmp" type="hidden" value="TEMP" />
<input name="rid" type="hidden" value="" />
<input name="cid" type="hidden" value="" />
<input name="mUserID" type="hidden" value="5" />
<input name="type" type="hidden" value="" />
<tr>
<td align="right" valign="top"><b> Message </b></td>
<td valign="top" align="left"><textarea cols="80" rows="10" wrap="virtual" name="message">Test</textarea></td>
</tr>
<tr>
<td align="right" valign="top"><b>Do you want this to be a Global request</b></td>
<td valign="top" align="left"><select setselected="0" name="mGlobal">
<option value="0">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
<tr>
<td align="right" valign="top"><b></b></td>
<td valign="top" align="left"><input name="submit" value="Submit Message" type="submit" /></td>
</tr>
</form>

Reproduce code:
---------------
$form = new HTML_QuickForm('connect', 'post',$action="$srv?caseid=connect");

//***************** BUG IN QUICKFORMS
// FOR SOME REASON THIS BROKE and the first line is needed to buffer an error with quickforms
//if ttmp is removed RID wont post
$form->addElement('hidden','ttmp','TEMP');
$form->addElement('hidden','rid',$rid);
$form->addElement('hidden','cid',$cid);
$form->addElement('hidden','mUserID',$mUserID) ;
$form->addElement('hidden','type',$type );

$renderer =& $form->defaultRenderer();

$rtemp="\n<TABLE width=$maintablewidth class=boxborder align=$maintablealign border=0 ".
"cellspacing=0 colspan=5 bgcolor=#FFFFFF nowrap>\n".
"<form{attributes}{content}\n</form></table>\n";
$renderer->setFormTemplate($rtemp);
$cmsg="Test";

$defaultValues = Array("message"=>$cmsg);
$form->setDefaults($defaultValues);

$form->addElement('textarea','message'," Message ",'cols="80" rows="10" wrap="virtual"');
$yesno=Array(0=>"No",1=>"Yes");
$setselect=Array("SetSelected"=>0);
$form->addElement('select', 'mGlobal', 'Do you want this to be a Global request', $yesno, $setselect);

$form->addElement('submit', 'submit', 'Submit Message');

Expected result:
----------------
To get the rid hidden field, but it doesnt post correctly on internet explorer 6.