Download - LinuxFocus
Transcript
Chapter 7
•
•
•
•
•
•
•
form_password()
form_upload()
form_textarea()
form_multiselect()
form_checkbox()
form_radio()
form_close()
The CI form helper generates an HTML portion that is rendered as part of the HTML
file that is returned to the browser.
For example, let's take a look at a drop-down selection example of a color pickup.
<HTML>
<?PHP
$attr = ' class="nice_field" ';
$options = array();
$options[0] = 'Blue';
$options[1] = 'Green';
$options[2] = 'Yellow';
$default
= 1;
echo form_dropdown("color", $options, $default, $attr);
?>
The form_dropdown helper will generate the following code:
<select class="nice_field" name="color">
<option value="0»>Blue</option>
<option selected=»selected» value=»1»>Green</option>
<option value=»2»>Yellow</option>
</select>
For more information, refer to the CI form help user manual.
AJAX
Asynchronous JavaScript and XML services (AJAX) (http://en.wikipedia.org/
wiki/Ajax) of JavaScript/jQuery integration within a view is critical today in
almost any web application. It provides an advanced user experience by operating
asynchronously in parallel to the user operations, and updates only certain HTML
selector portions and not the entire page as anon AJAX updates operate.
[ 149 ]