Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update system/helpers/form_helper.php

Example use: 
// PHP
form_hidden('status_id', '0', FALSE, 'id="status_id_for_update"');
...
// JavaScript
$('#event').change(function() {
  $('#status_id_for_update').val('1');
});
  • Loading branch information...
commit 130c5f4dc0cea4ef5e522b0e2ad1d3cdbae525c8 1 parent cf512a6
JFox authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 system/helpers/form_helper.php
8 system/helpers/form_helper.php
View
@@ -129,7 +129,7 @@ function form_open_multipart($action = '', $attributes = array(), $hidden = arra
* @param bool
* @return string
*/
- function form_hidden($name, $value = '', $recursing = FALSE)
+ function form_hidden($name, $value = '', $recursing = FALSE, $extra = '')
{
static $form;
@@ -142,21 +142,21 @@ function form_hidden($name, $value = '', $recursing = FALSE)
{
foreach ($name as $key => $val)
{
- form_hidden($key, $val, TRUE);
+ form_hidden($key, $val, TRUE, $extra);
}
return $form;
}
if ( ! is_array($value))
{
- $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value, $name)."\" />\n";
+ $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value, $name)."\" '.$extra.' />\n";
}
else
{
foreach ($value as $k => $v)
{
$k = is_int($k) ? '' : $k;
- form_hidden($name.'['.$k.']', $v, TRUE);
+ form_hidden($name.'['.$k.']', $v, TRUE, $extra);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.