Welcome Guest, Not a member yet? Register   Sign In
Retrieve a specific value from option value populated from database
#1

[eluser]rainfall[/eluser]
Earlier i worked with a dropdown that shows id in a text box from selected name ..

But now i retrieve both id and name in option value . and save separately in database using PHP explode function ..
Code:
<option value="&lt;?php echo $row->branch_name. '|'. $row->branch_id;?&gt;">  &lt;?php echo $row->branch_name ?&gt; </option>

Code earlier used for display id in a text box below

in View
Code:
echo '<option value="'.$row->emp_id.'">'.$row->employee_name.'</option>';
Jquery In view
Code:
[removed][removed]
[removed]
$(document).ready( function() {
    $('#empName').change( function() {
        // enter in an empty field code of the selected bank
        $('#empId').val( $(this).val() );
    });
});
[removed]
Its only works for only a single value in option

Now if I want to show only branch_name or brach_id in a text box below what to do in Jquery ??


Messages In This Thread
Retrieve a specific value from option value populated from database - by El Forum - 09-09-2014, 07:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB