How to Create a Hidden Field

The Form::hidden() method works exactly the same as the Form::input() method except that it automatically sets the type attribute to hidden.

  echo Form::hidden('name');
  <input type="hidden" name="name" />

Add the second parameter to declare a value

  echo Form::hidden('name', 'value');
  <input type="hidden" name="name" value="value" />

The third parameter accepts an array of attributes

  echo Form::hidden('name', 'value', array('id'=>'name'));
  <input type="hidden" name="name" value="value" id="name" />
how_to_create_a_hidden_field.txt · Last modified: 2009/10/18 00:14 by kerkness