I have two hidden fields inside a form, they must store the values of a radio button and the selected checkboxes (150 checkboxes), I was able to make the first hidden field load the value of the selected radio button but I could not make the that the 2nd hidden store the various checked checkboxes
<form class="navbar-form span7 text-center" role="search" id="search-form" action="../PHP/ValidateForm.php" method="get">
<div class="form-group">
<label class="radio-inline"><input type="radio" name="result_type" value="videos" checked="">Videos</label>
<label class="radio-inline"><input type="radio" name="result_type" value="photos">Photos</label>
<label class="radio-inline"><input type="radio" name="result_type" value="tumblr">Tumblr</label>
</div>
<div class="input-group">
<input class="form-control" type="text" id="search_input" name="search_input" placeholder="Search" />
<div class="input-group-btn">
<button class="btn btn-default" type="submit" name="search_form_submit" value="search">Search</button>
</div>
</div>
<input type="hidden" name="upload-date" value="up-0" />
<input type="hidden" name="from" value="" />
</form>
Radio buttons and checkboxes code:
<div id="right_sidebar" class="col-md-2"><!-- START Right Sidebar -->
<div class="row">
<h4>Upload Date</h4>
<div class="radio">
<label><input type="radio" name="upload-date" value="up-0" checked="checked">ANYTIME</label>
</div>
<div class="radio">
<label><input type="radio" name="upload-date" value="up-1">Today</label>
</div>
<div class="radio">
<label><input type="radio" name="upload-date" value="up-2">This Week</label>
</div>
<div class="radio">
<label><input type="radio" name="upload-date" value="up-3">This Month</label>
</div>
<h4>From</h4>
<div id="sites-list">
<div class="checkbox">
<label><input type="checkbox" name="site[]" value="site-0" checked="checked">ANYONE</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="site[]" value="site-1">Site</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="site[]" value="site-2">Site</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="site[]" value="site-3">Site</label>
</div>
</div>
</div>
Code that works only to enter the value of the radio button to the 1st hidden
$('input[name=upload-date]').change(function(){
$('#search-form > input[name=upload-date]').val($(this).val());
});