Home How can i write return on submit in active form in codeigniter?
Reply: 3

How can i write return on submit in active form in codeigniter?

Arsh Khan
1#
Arsh Khan Published in 2018-02-14 06:00:28Z

I want to use onsubmit="return travel_form(this); in active form

 <?php echo form_open_multipart('employee/travel/store_travel' ,['id'=>'abc']); ?>

How to use it. Please guide me.

prakash tank
2#
prakash tank Reply to 2018-02-14 06:04:52Z

You can do with this :

<?php  array('onsubmit' => "return travel_form(this)"); ?>
Riyenz
3#
Riyenz Reply to 2018-02-14 06:19:47Z

Simply put it on your 2nd parameter which is the attribute

<?php 

     $attribute = array(
                    'id' => 'abc',
                    'onsubmit'  =>  'return travel_form(this)'
     );
     echo form_open_multipart('employee/travel/store_travel' , $attribute); 
?>
Nitin
4#
Nitin Reply to 2018-02-14 11:00:52Z

This is another way.

<?php $data = array('id'       =>  'abc', 
                    'onsubmit' =>  'return travel_form(this);');

echo form_open_multipart('employee/travel/store_travel' ,$data); 
?>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.41113 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO