Today, We want to share with you form_open in codeigniter.In this post we will show you form action in codeigniter, hear for $this- input- post not working codeigniter we will give you demo and example for implement.In this post, we will learn about How To Call Helper Function In Codeigniter View with an example.
Codeigniter form_open Form Helper Library Example
Controller Part
Codeigniter form_open Example :
load->helper('form'); $this->load->library('form_validation'); $this->load->view('login_view'); } }
View Part | login_view.php
Codeigniter form_open Example :
CodeIgniter Form Helper
Functions of Form Helper
echo form_open( 'Online/form' ); $attributes = array('class' => 'online', 'id' => 'form'); echo form_open('Online/form', $attributes); $hidden = array( 'type' => 'text', 'name' => 'Maeve', 'value' => '[email protected]', 'class' => 'onlinehub ' ); echo form_open('Online/form', $attributes, $hidden);
form_close():
echo form_open( 'Online/form' ); echo form_close();
form_open_multipart()
echo form_open_multipart( 'Online/form', $attributes); echo form_close();
form_hidden()
echo form_open(); echo form_hide( ‘student’ , ‘Otis’); echo form_close();
form_input()
$input_data = array( 'name' => 'tname', 'id' => 'tname_id', 'value' => 'ERIC ' 'readonly' => 'readonly' 'placeholder' => 'Enter Your Name' ); echo form_input($input_data);
form_password()
$input_data = array( 'name' => 'tname', 'id' => 'tname_id', 'value' => 'ERIC ' 'readonly' => 'readonly' 'placeholder' => 'Enter Your Name' ); echo form_input($input_data);
form_upload():
$upload_data = array( 'type' => 'file', 'name' => 'upload_file' ); echo form_upload($upload_data);
form_textarea()
$rough_textarea = array( 'name' => 'textarea', 'rows' => 5, 'cols' => 30 ); echo form_textarea($rough_textarea);
form_dropdown():
form_dropdown ([ $name = ‘ ‘ [, $options = array() [, $selected = array() [, $extra = ‘ ‘ ] ] ] ]);
form_multiselect()
echo form_label('Languages Known '. " "); $language = array( 'LA' => 'LARAVEL', 'PP' => "PHP", 'AJ' => 'ANGULARJS', 'VE' => 'VUEJS', 'JS' => 'JavaScript', ); echo " ".form_multiselect("Show[]", $language);
form_fieldset()
echo form_open() $fieldset_data = array( 'id' => 'student_info, 'class' => 'student_detail' ); echo form_fieldset(‘Student information, $fieldset_data); echo "Enter your details here
"; echo form_close();
I hope you get an idea about codeigniter form submit to database.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.