I need some idea here.. i wanted to make search function using combo box. after user has selected certain value from the combo box...based on selected value checkbox will appears...
example ...
[combo box] -> select 1.user 2.item 3.tag
when user select "user"
checkbox as follow will appears
checkbox- update user checkbox-delete user
and so forth... this to filter more.. and make user easy to find/view what they want from their search...
if you have other idea..instead of using combo box and check box.. please let me know..
thankssssssss :)
Give your select list an ID.
Using jQuery:
$(document).ready(function(){
$("#mySelect").change(function(){
var selectValue = $("#mySelect").val();
switch(selectValue){
case "someValue":
var checkbox = '<input type="checkbox" name="something" value="something" />'
$("#someDiv").append(checkbox);
break;
case "someOtherValue":
var checkbox = '<input type="checkbox" name="something" value="something" />'
$("#someDiv").append(checkbox);
break;
}
});
});
And so on. Hopefully, you get the idea.
finally i managed to do... thanks all for your help ... this is what i did
select statement
echo '<select name="SearchCriteria" id="SearchCriteria" style="font:12px Verdana ; width:150px;" >';
echo '<option value="">Select Search</option>';
for ($i =0; $i<$rowcount; $i++)
{
$row = mysql_fetch_array($sql);
echo
'<option ';
$value = $row['p_on'];
echo 'value="' . $value . '">' . $value .'</option>';
}
echo '</select>';
div and script below the select statement
<div id="Checkbox"></div>
<script>
$("select").change(function(){
var selectValue = $("select").val();
switch(selectValue){
case "user":
var checkbox = '<input type="checkbox" name="something" value="something" />'
$("#Checkbox").append(checkbox);
break;
case "tag":
var checkbox = '<input type="checkbox" name="something" value="something" />'
$("#Checkbox").append(checkbox);
break;
}
});
</script>