I want to set the hidden input field value to selected drop box value. Here is my hidden field code and drop box code.
{!! Form::hidden('color') !!}
{!! Form::select('type', array('type' => 'type','Orange' => 'Orange', 'Red' => 'Red','Green' => 'Green'), 'type') !!}
Below is my jquery.
<script>
$(document).ready(function(){
$('#type').on('change',function(){
$('#color').val($(this).val());
});
$('#Orange').on('change',function(){
$('#color').val($(this).val());
});
$('#Red').on('change',function(){
$('#color').val($(this).val());
});
$('#Green').on('change',function(){
$('#color').val($(this).val());
});
});
But as the hidden field value it will not set the value. Why is that?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire