• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get one form_input to show up in another?

#6
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')); ?>
<?php 
echo form_input(array('id' => 'input2''name' => 'url''class' => 'form-control')); ?>

<script>
 $(document).ready(function() {
   $('#input1').keyup(function() {
       var text = $('#input1').val();
       $('#input2').val(text);
   });
 });
 </script> 
Reply


Messages In This Thread
RE: How to get one form_input to show up in another? - by Wouter60 - 04-21-2016, 01:32 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.