Codeigniter form_open specify id
39,118
Solution 1
https://codeigniter.com/user_guide/helpers/form_helper.html
$attributes = array('id' => 'myform');
echo form_open('email/send', $attributes);
Solution 2
You can also use:
echo form_open('controller/method',array('id'=>$id,'method'=>'post'))
Solution 3
echo form_open('controller/method',array('id'=>$id,'method'=>'post'))
Related videos on Youtube
Author by
Roman
Updated on July 09, 2022Comments
-
Roman almost 2 years
How can I write the form ID in the form_open function in CodeIgniter? (I need to use the ID for the CSS). For example, this is simple HTML:
<form method="post" action="" id="my_form">
I am trying the following code, but it does not work:
<?php echo form_open('my_form'); ?>
Thanks.
-
Otto almost 13 yearsYou should research more into de user guide next time. codeigniter.com/user_guide/helpers/form_helper.html
-
-
Magisch over 7 yearsPlease consider adding explanations to your code. While it may be self-explanatory to you, other people could very much benefit from some added explaination as to why and how your code solves the question problem.