Home > Net >  How to write form tag in codeignter
How to write form tag in codeignter

Time:06-28

I have use codeignter, I need to write form tag using codeignter how to do this I don't need normal html form tag.

<Form>

I don't need like this

CodePudding user response:

You can try it like this

<?php
    echo form_open('create_user.php', ['id' => 'Your Id']); #formOpen    
    echo form_close(); #formClosing
?>

reference by Codeigniter Official Document click here

CodePudding user response:

Here is an example of form helper in codeigniter.

<?php
    echo form_open('create_user.php', ['id' => 'frmUsers']); #formTagOpen
        
    echo form_label('User Id', 'user_id'); #formLabel
    echo form_input(['name' => 'user_id']); #formInput
        
    echo form_label('Password', 'password'); #formLabel
    echo form_input(['type' => 'password', 'name' => 'password']); #formInputPassword
        
    echo form_submit('btnSubmit', 'Create User'); #formSubmitButton
        
    echo form_close(); #formClosingTag
?>

To learn more you can refer this

  • Related