How to get one form_input to show up in another? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to get one form_input to show up in another? (/showthread.php?tid=64984) |
How to get one form_input to show up in another? - doomie22 - 04-17-2016 Hi there, I am just wondering if there is a way of having a non-usable input section show up what someone is typing in another input? Thanks, Doomie RE: How to get one form_input to show up in another? - acsv - 04-17-2016 If you want this in real time you would probably want to use javascript. RE: How to get one form_input to show up in another? - doomie22 - 04-18-2016 I have found a couple but none of them seems to want to work with my form RE: How to get one form_input to show up in another? - Wouter60 - 04-18-2016 jQuery is your best friend. Load the jQuery library in your page's head section. Then, at the bottom of your page (preferrably after the </body> tag): Code: <script> More info: https://api.jquery.com/keyup/ RE: How to get one form_input to show up in another? - doomie22 - 04-21-2016 I have been trying to mess around to get this to work. The following 2 lines are the part of the comlpete form that I want it to copy to. PHP Code: <?php echo form_input(array('id' => 'input1', 'name' => 'name', 'class' => 'form-control'),'' , $js); ?> I have added the code in the above post and added jquery and it just seems to do nothing and I cannot see why. RE: How to get one form_input to show up in another? - Wouter60 - 04-21-2016 You didn't describe the value of the $js variable, but in general, jQuery can handle elements by their id or class. It should work if you do this: PHP Code: <?php echo form_input(array('id' => 'input1', 'name' => 'name', 'class' => 'form-control')); ?> |