Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB