You can do this:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('#combo').change(function(){
console.log($(this));
$.get( "ABC.php" , { option : $(this).val() } , function ( data ) {
$ ( '#comboB' ) . html ( data ) ;
} ) ;
});
});
</script>
</head>
<body>
<div id="comboBox">
<fieldset>
<form>
<select name="combo" id="combo">
<option value="">-- Select</option>
<option value="1">Fruits</option>
<option value="2">Vegetables</option>
</select>
<select name="comboB" id="comboB">
<option value="">--</option>
</select>
</form>
</fieldset>
</div>
</body>
</html>
Then in the PHP page, you get an array with the data to be added to the drop box, of course you'll also have to send an ajax call to populate the drop box, then in the php page, you have the following:
<?php
$Options = Array (
1 => Array (
'Apple' ,
'Orange'
) ,
2 => Array (
'Radish' ,
'Lettuce'
)
) ;
forEach ( $Options [ $_GET [ 'option' ] ] as $Item ) {
printf ( '<option value="%s">%s</option>' , $Item , $Item ) ;
}
Now, you just need to adjust the validations .. etc.