In select the user is chosen and the address and email of the selected user are entered in the two inputs .
I would like to know if it is possible to have 2 possible inputs to feed the inputs .
My current code is this:
<script type="text/javascript">
$(document).on('change', '.get-placa', function () {
var value = $(this).val();
$('.close').trigger('click');
$('.nome').val(value);
$('.email').val("<?php echo $row['email'];?>");
});
<div class="control-group col1">
<label class="control-label"><?php echo get_phrase('patient');?></label>
<div class="controls">
<select class="form-control get-placa chzn-select" type="text" name="patient_id">
<option value="">select</option>
<?php
$patients = $this->db->get('patient')->result_array();
foreach($patients as $row):
?>
<option value="<?php echo $row['address'];?>"><?php echo $row['name'];?></option>
<?php
endforeach;
?>
</select>
</div>
</div>
<div class="control-group col1">
<label class="control-label"><?php echo get_phrase('endereço');?></label>
<div class="controls">
<input readonly="true" type="text" class="form-control nome" name="nome">
</div>
</div>
<div class="control-group col1">
<label class="control-label"><?php echo get_phrase('email');?></label>
<div class="controls">
<input readonly="true" type="text" class="form-control email" name="email">
</div>
</div>
</script>