Botão desfazer
galera, tenho um sistema de form que vou adicionando campos ao form.
so que quando seleciono mais do que necessito, como posso fazer para desfazer?
segue modelo.
<script language="javascript">
var input = 0;
function mais(campo) {
var nova = document.getElementById("aqui");
var novadiv = document.createElement("div");
var nomediv = "div";
novadiv.innerHTML = "Quantidade: <input type='text' name='qtd[]' value='' style='width:193px;height:20px;'> Produto: <select name='prod[]' id='produto'><option value='0'><Selecione o tipo></option><?php while($array = mysql_fetch_array($sql_tipo)) {?><option label='<?php echo $array[nome] ?>' value='<?php echo $array[nome].'_'.$array[precovenda]; ?>'><?php echo $array[nome] ?> - <?php echo $array[precovenda] ?></option><?php } ?></select> Desconto no Produto: <input type='text' name='desconto[]' value='' onkeypress='mascara(this,mvalor)' style='width:193px;height:20px;'> ";
nova.appendChild(novadiv);
input++;
}</script>
<form method='post' action='recebe_itensos.php'>
<input type="hidden" name="id_os" value="<?php echo $id ; ?>" />
<input type='button' value='Inserir Produto na OS' onClick='mais(campo.value)'>
<input type='hidden' name='campo' value=''>
<div id='aqui'>
</div>
<input type='submit' name='enviar' value='Enviar Itens Da OS'>
</form>
pois alem de incluir gostaria de excluir.
Discussão (1)
Carregando comentários...