summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/changelog.html1
-rw-r--r--user_guide/libraries/validation.html39
2 files changed, 40 insertions, 0 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 2771a14e9..01acd0f41 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -90,6 +90,7 @@ a suggestion offered by coolfactor in our forums. Please check the documentatio
<li>Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.</li>
<li>Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.</li>
<li>Updated the <dfn>input->cookie()</dfn> and <dfn>input->post()</dfn> functions in <a href="./libraries/input.html">Input Class</a> to permit arrays contained cookies that are arrays to be run through the XSS filter.</li>
+<li>Documented three functions from the <a href="./libraries/validation.html">Validation class</a> that were missing from the user guide: set_select(), set_radio(), and set_checkbox().</li>
<li>Fixed a bug in the Email class related to SMTP Helo data.</li>
<li>Fixed a bug in the validation class.</li>
<li>Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.</li>
diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html
index 3a724831f..1af3c32fa 100644
--- a/user_guide/libraries/validation.html
+++ b/user_guide/libraries/validation.html
@@ -664,6 +664,45 @@ like <kbd>trim</kbd>, <kbd>htmlspecialchars</kbd>, <kbd>urldecode</kbd>, etc.</p
<p>Where <var>rule</var> corresponds to the name of a particular rule, and <var>Error Message</var> is the text you would like displayed.</p>
+<h2>Dealing with Select Menus, Radio Buttons, and Checkboxes</h2>
+
+<p>If you use select menues, radio buttons or checkboxes, you will want the state of
+these items to be retained in the event of an error. The Validation class has three functions taht help you do this:</p>
+
+<h2>set_select()</h2>
+
+<p>Permits you to display the menu item that was selected. The first parameter
+must contain the name of the select menu, the second parameter must contain the value of
+each item. Example:</p>
+
+<code>
+&lt;select name="myselect"><br />
+&lt;option value="one" <dfn>&lt;?= $this->validation->set_select('myselect', 'one'); ?></dfn> >One&lt;/option><br />
+&lt;option value="two" <dfn>&lt;?= $this->validation->set_select('myselect', 'two'); ?></dfn> >Three&lt;/option><br />
+&lt;option value="three" <dfn>&lt;?= $this->validation->set_select('myselect', 'three'); ?></dfn> >Three&lt;/option><br />
+&lt;/select>
+</code>
+
+
+<h2>set_checkbox()</h2>
+
+<p>Permits you to display a checkbox in the state it was submitted. The first parameter
+must contain the name of the checkbox, the second parameter must contain its value. Example:</p>
+
+<code>&lt;input type="checkbox" name="mycheck" value="1" <dfn>&lt;?= $this->validation->set_checkbox('mycheck', 1); ?></dfn> /></code>
+
+
+<h2>set_radio()</h2>
+
+<p>Permits you to display radio buttons in the state they were submitted. The first parameter
+must contain the name of the radio button, the second parameter must contain its value. Example:</p>
+
+<code>&lt;input type="radio" name="myradio" value="1" <dfn>&lt;?= $this->validation->set_radio('myradio', 1); ?></dfn> /></code>
+
+
+
+
+
</div>
<!-- END CONTENT -->