Guest User

Untitled

a guest
Dec 14th, 2012
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function(){
  2.  
  3.     $('#add').click(function(){
  4.         var input = '<div class="field">';
  5.             input += 'Produto: <select name="produto[]">';
  6.             input += '<option value=""></option>';
  7.         <?php while($row = mysql_fetch_assoc($rsProduto)) : ?>
  8.             input += '<option value="<?php echo $row['id_produto']?>"><?php echo $row['nome_produto']?></option>';
  9.         <?php endwhile?>
  10.             input += '</select>';
  11.             input += 'Valor: <input type="text" name="valor[]"  />';
  12.             input += 'Qtd: <input type="text" name="qtd[]"  />';
  13.             input += '<a href="#" class="del">X</a> ';
  14.             input += '</div> ';
  15.  
  16.         $('#campos').append(input);
  17.         return false;
  18.     });
  19.  
  20.     $('.del').live('click', function(){
  21.         $(this).parent().remove();
  22.     });
  23. });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×