Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- $('#add').click(function(){
- var input = '<div class="field">';
- input += 'Produto: <select name="produto[]">';
- input += '<option value=""></option>';
- <?php while($row = mysql_fetch_assoc($rsProduto)) : ?>
- input += '<option value="<?php echo $row['id_produto']?>"><?php echo $row['nome_produto']?></option>';
- <?php endwhile?>
- input += '</select>';
- input += 'Valor: <input type="text" name="valor[]" />';
- input += 'Qtd: <input type="text" name="qtd[]" />';
- input += '<a href="#" class="del">X</a> ';
- input += '</div> ';
- $('#campos').append(input);
- return false;
- });
- $('.del').live('click', function(){
- $(this).parent().remove();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement