Thank you for your cooperation. As you requested follows the jquery code and the code of the form. Friend takes a lot to help me. I can not solve this riddle.
CÓDIGO FORM:
<table cellspacing="0" border="0">
<thead>
<tr>
<td style="padding:10px;">Quantidade</td>
<td style="padding:10px;">Descrição</td>
<td style="padding:10px;">Valor Unitário</td>
<td style="padding:10px;">Total do Ítem</td>
<td style="padding:10px;"> </td>
</tr>
</thead>
<tbody id="repetir">
<tr id="linha_1">
<td style="padding:10px;"><input name="dia[]" type="text" value="" size="3" maxlength="3" style="padding:5px;" /></td>
<td style="padding-top:22px; padding-left:10px;">
<?php
include("con_query/BDconex.php");
$querys = mysql_query("SELECT * FROM itens ORDER BY PRO_NOME ASC");
?>
<select name="search_category" id="search_category_id" style="width:200px;">
<option selected>Selecione um Produto</option>
<?php
while ($rows = mysql_fetch_array($querys)){
?>
<option value="<?php echo $rows['PRO_ID']; ?>"><?php echo utf8_encode($rows[PRO_NOME]); ?></option>
<?php
}
?>
</select>
</td>
<td style="padding:10px;">
<div class="both">
<div id="show_sub_categories" align="center">
<img src="loader.gif" style="margin-top:8px; float:left" id="loader" alt="" />
</div>
</div>
</td>
<td style="padding:10px;">
<input name="hora[]" type="text" value="" size="3" maxlength="3" style="padding:5px;" />
</td>
<td style="padding:10px;"><input type="button" value="Remover" id="remove" onClick="$.removeLinha(this);" style="padding:5px;" /></td>
</tr>
</tbody>
<tfoot>
<tr>
<td align="right" colspan="5"><input type="button" value="Adicionar" id="add" /></td>
</tr>
</tfoot>
</table>
CÓDIGO JQUERY:
<script type="text/javascript">
$(document).ready(function() {
$('#loader').hide();
$('#show_heading').hide();
$('#search_category_id').change(function(){
$('#show_sub_categories').fadeOut();
$('#loader').show();
$.post("js/dynamic_dropdown/get_chid_categories.php", {
parent_id: $('#search_category_id').val(),
}, function(response){
setTimeout("finishAjax('show_sub_categories', '"+escape(response)+"')", 400);
});
return false;
});
});
function finishAjax(id, response){
$('#loader').hide();
$('#show_heading').show();
$('#'+id).html(unescape(response));
$('#'+id).fadeIn();
}
function alert_id()
{
if($('#sub_category_id').val() == '')
alert('Please select a sub category.');
else
alert($('#sub_category_id').val());
return false;
}
</script>