HTML_QickForm > AdvMultiselect
| From: | Mark Steudel | Date: | Fri, 19 Sep 2008 00:15:57 +0000 |
| Subject: | HTML_QickForm > AdvMultiselect | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-29271@lists.php.net to get a copy of this message | ||
I am using the advmulti select for quickform and it is working fine on my
laptop (windows xp, apache, php 5+, mysql) . But when I upload my code to
the linux box and the javascript doesn't print out. Here's a set of test
code that demonstrates the problem:
$form = new HTML_QuickForm( 'groupForm' );
$renderer =& $form->defaultRenderer();
// apply classes
$alignLeft = "\n\t<tr>\n\t\t<th align=\"right\" valign=\"top\"
class=\"align_right\"><!-- BEGIN required --><span style=\"color:
#ff0000\">*</span><!-- END required
--><b>{label}</b></th>\n\t\t<td
valign=\"top\" class=\"align_left\"><!-- BEGIN error --><span
style=\"color:
#ff0000\">{error}</span><br /><!-- END error
-->\t{element}</td>\n\t</tr>";
$renderer->setElementTemplate($alignLeft);
$form->addElement( 'advmultiselect', 'markets', 'Markets: ', array(
'test',
'test2', 'test3') );
echo $form->toHTML();
Here's part of the html that is spit out:
<tr>
<th align="right" valign="top"
class="align_right"><b>Markets: </b></th>
<td valign="top" class="align_left">
<script type="text/javascript">
//<![CDATA[
//]]>
</script>
<table border="0" cellpadding="10" cellspacing="0"><tr>
<td valign="top"><select name="markets-f[]"
multiple="multiple" size="10"
style="width:100px;" id="markets-f"
ondblclick="qfamsMoveSelection('markets',
this.form.elements['markets-f[]'],
this.form.elements['markets-t[]'], this.form.elements['markets[]'],
'add',
'none')">
<option value="0">test</option>
<option value="1">test2</option>
<option value="2">test3</option>
</select></td>
Thanks in advance, Mark