From 904094a177488edeacbe8e184d788c286c3e3d9f Mon Sep 17 00:00:00 2001
From: Derek Allard
Date: Tue, 10 Feb 2009 14:00:34 +0000
Subject: Changed the default "type" of form_button() to "button" from "submit"
in the form helper.
---
system/helpers/form_helper.php | 2 +-
user_guide/changelog.html | 3 ++-
user_guide/helpers/form_helper.html | 2 +-
user_guide/helpers/html_helper.html | 7 ++++++-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 8cae91a41..4a62cdb5e 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -424,7 +424,7 @@ if ( ! function_exists('form_button'))
{
function form_button($data = '', $content = '', $extra = '')
{
- $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit');
+ $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'button');
if ( is_array($data) AND isset($data['content']))
{
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index c5a2d667b..c66ff2314 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -85,7 +85,8 @@ SVN Revision:
- Added the ability to have optgroups in form_dropdown() within the form helper.
- Added a doctype() function to the HTML helper.
- - Added ability to force lowercase for url_title() in the URL helper.
+ - Added ability to force lowercase for url_title() in the URL helper.
+ - Changed the default "type" of form_button() to "button" from "submit" in the form helper.
Other Changes
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
index 8504ac02f..ae3b07e53 100644
--- a/user_guide/helpers/form_helper.html
+++ b/user_guide/helpers/form_helper.html
@@ -350,7 +350,7 @@ fourth parameter:
echo form_button('name','content');
// Would produce
-<button name="name" type="submit">Content</button>
+<button name="name" type="button">Content</button>
Or you can pass an associative array containing any data you wish your form to contain:
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
index fd92f4dcb..e6a65277a 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -166,6 +166,11 @@ echo ul($list, $attributes);
$this->load->helper('html');
+$attributes = array(
+ 'class' => 'boldlist',
+ 'id' => 'mylist'
+ );
+
$list = array(
'colors' => array(
'red',
@@ -197,7 +202,7 @@ $list = array(
);
-echo ul($list);
+echo ul($list, $attributes);
The above code will produce this:
--
cgit v1.2.3-24-g4f1b