cvs: peardoc /en/package/html/html-template-flexy/attribute form.xml
| From: | Alan Knowles | Date: | Mon, 24 May 2004 06:21:18 +0000 |
| Subject: | cvs: peardoc /en/package/html/html-template-flexy/attribute form.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-4083@lists.php.net to get a copy of this message | ||
alan_k Mon May 24 02:21:18 2004 EDT
Modified files:
/peardoc/en/package/html/html-template-flexy/attribute form.xml
Log:
fix radio button example
http://cvs.php.net/diff.php/peardoc/en/package/html/html-template-flexy/attribute/form.xml?r1=1.4&r2=1.5&ty=u
Index: peardoc/en/package/html/html-template-flexy/attribute/form.xml
diff -u peardoc/en/package/html/html-template-flexy/attribute/form.xml:1.4
peardoc/en/package/html/html-template-flexy/attribute/form.xml:1.5
--- peardoc/en/package/html/html-template-flexy/attribute/form.xml:1.4 Thu Jan 29 11:32:26 2004
+++ peardoc/en/package/html/html-template-flexy/attribute/form.xml Mon May 24 02:21:17 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="package.html.html-template-flexy.tag.form">
<refnamediv>
<refname><FORM NAME="name"</refname>
@@ -69,8 +69,10 @@
$elements['test_checkbox[]']->setValue(array(1,2));
// radio buttons
+$val = 'yes';
$elements['test_radio'] = new HTML_Template_Flexy_Element;
-$elements['test_radio']->setValue('yes');
+// if you have a default - you may want default to using it..
+$elements['test_radio']->setValue($val != 'no' ? $val : 'no');
$form->output(new StdClass, $elements);
@@ -98,8 +100,9 @@
<input name="test_checkbox_array[]" type="checkbox"
value="2">2<BR>
<input name="test_checkbox_array[]" type="checkbox"
value="3">3<BR>
- <input name="test_radio" type="radio"
value="yes">yes<BR>
- <input name="test_radio" type="radio"
value="no">no<BR>
+ <!-- you need to use id's -->
+ <input name="test_radio" type="radio" id="radio_yes"
value="yes">yes<BR>
+ <input name="test_radio" type="radio" id="radio_no"
value="no">no<BR>
</FORM>
</BODY>
@@ -132,8 +135,8 @@
<input name="test_checkbox_array[]" type="checkbox" value="2"
checked>2<BR>
<input name="test_checkbox_array[]" type="checkbox"
value="3">3<BR>
- <input name="test_radio" type="radio" value="yes"
checked>yes<BR>
- <input name="test_radio" type="radio"
value="no">no<BR>
+ <input name="test_radio" type="radio" value="yes"
id="radio_yes" checked>yes<BR>
+ <input name="test_radio" type="radio" value="no"
id="radio_no">no<BR>
</FORM>