Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Messiah

mais campo formulario

Recommended Posts

Estou montando um formulario de pedido...Dai a pessoa vai adicionando mais linhas... no caso... aparecem 3 input para colocar os produtos dai queria botar um botao para adicionar mais inputs text conforme ele achace necessario.. como poderia fazer isso sem ter q dar milhoes de refresh?

Compartilhar este post


Link para o post
Compartilhar em outros sites

com base no seu codigo montei um aqui.. mais to tendo uma certa dificuldade no IE.. mozilla ta 100%...

 

 

 

quando coloco os input text e seto uma class pra ele.. ele vem doidao.. nao pega o estilo.. alguem sabe oq poderia ser?

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- saved from url=(0014)about:internet --><html xmlns="http://www.w3.org/1999/xhtml"><head><title>:: Narciso ::</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">td img {display: block;}body,td,th {	font-family: Tahoma, Arial, Sans-serif;	font-size: 10px;	color: #333333;}body {scrollbar-arrow-color:#999999;scrollbar-3dlight-color:#999999;scrollbar-highlight-color:#ffffff;scrollbar-face-color:#f1f1f1;scrollbar-shadow-color:#f1f1f1;scrollbar-darkshadow-color:#999999;scrollbar-track-color: #CCCCCC;}.style1 {font-size: 9px}.style3 {font-size: 10px}.style4 {font-family: Verdana, Arial, Helvetica, sans-serif;	font-size: 10px;}.style5 {font-family: Verdana, Arial, Helvetica, sans-serif;	font-size: 10px;	color:#003300;}</style><!--Fireworks 8 Dreamweaver 8 target.  Created Tue Sep 19 11:57:40 GMT-0300 (Hora oficial do Brasil) 2006--><script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script><script language="javascript" type="text/javascript">var x = 2;function campo(){	var newfont = document.createElement("font");	newfont.setAttribute('face', 'Verdana');	newfont.setAttribute('size', '2');	newfont.setAttribute('color', '#003300');				var newrow = document.createElement("TR");	var newcol , newinput;	newcol = document.createElement("TD");	newrow.appendChild(newcol);	newcol = document.createElement("TD");	newrow.appendChild(newcol);	newcol = document.createElement("TD");	newcol.setAttribute('width', '95');	newinput = document.createElement('input');	newinput.setAttribute('type', 'text');	newinput.setAttribute('size', '20');	newinput.setAttribute('class', 'style5');					newinput.setAttribute('id', 'txtProd0' + x);		newcol.appendChild(newinput);	newrow.appendChild(newcol);	newcol = document.createElement("TD");	newinput = document.createElement('input');	newinput.setAttribute('type', 'text');	newinput.setAttribute('size', '10');			newinput.setAttribute('class', 'style5');						newinput.setAttribute('id', 'txtQtd0' + x);		newcol.appendChild(newinput);	newrow.appendChild(newcol);	document.getElementById('tbDbBody').appendChild(newrow);	x++;	}</script></head><body bgcolor="#cccccc"><table width="762" border="0" align="center" cellpadding="0" cellspacing="0"><!-- fwtable fwsrc="interno.png" fwbase="empresa.jpg" fwstyle="Dreamweaver" fwdocid = "1529690315" fwnested="0" -->  <tr>   <td><img src="images/spacer.gif" width="48" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="113" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="53" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="133" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="88" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="180" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="91" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="56" height="1" border="0" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>  </tr>  <tr>   <td colspan="3"><a href="index.html"><img name="empresa_r1_c1" src="images/pedido_r1_c1.jpg" width="214" height="140" border="0" id="empresa_r1_c1" alt="" /></a></td>   <td colspan="2"><img name="empresa_r1_c4" src="images/pedido_r1_c4.jpg" width="221" height="140" border="0" id="empresa_r1_c4" alt="" /></td>   <td colspan="2"><img name="empresa_r1_c6" src="images/pedido_r1_c6.jpg" width="271" height="140" border="0" id="empresa_r1_c6" alt="" /></td>   <td rowspan="2"><img name="empresa_r1_c8" src="images/pedido_r1_c8.jpg" width="56" height="293" border="0" id="empresa_r1_c8" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="140" border="0" alt="" /></td>  </tr>  <tr>   <td rowspan="2"><img name="empresa_r2_c1" src="images/empresa_r2_c1.jpg" width="48" height="220" border="0" id="empresa_r2_c1" alt="" /></td>   <td colspan="3" rowspan="4" valign="top" background="images/empresa_r2_c2.jpg">   <form name="Lista" id="Lista" method="post" action="email.php">   <div style="overflow:auto;width:299px;height:310px" >   	 <table width="271"  border="0" cellspacing="0" cellpadding="0" id="tbDb">	 <tbody id="tbDbBody">	   <tr>		 <td width="53" height="20"><div align="right"><span class="style3">N</span>ome:</div></td>		 <td width="5"> </td>		 <td height="20" colspan="2"><input name="txtNome" type="text" class="style3" id="txtNome" size="40" /></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Pessoa:</div></td>		 <td> </td>		 <td height="20" colspan="2"><font face="Verdana" size="2" color="#003300"><strong><font face="Verdana" size="2" color="#003300"><strong> </strong></font></strong></font> <font face="Verdana" size="2" color="#003300"><strong><font face="Verdana" size="2" color="#003300"><strong>		   <select name="cbPessoa" size="1" class="style3" id="cbPessoa">			 <option selected="selected" value="0">Escolha</option>			 <option value="Física">Física</option>			 <option value="Jurídica">Jurídica</option>		   </select>		 </strong></font></strong></font> </td>	   </tr>	   <tr>		 <td height="20"><div align="right">CPF/CIC:</div></td>		 <td> </td>		 <td height="20" colspan="2"><font face="Verdana" size="2" color="#003300"><strong><font face="Verdana" size="2" color="#003300"><strong>		   <input name="txtCpf" type="text" class="style3" id="txtCpf" size="40" />		 </strong></font></strong></font></td>	   </tr>	   <tr>		 <td height="20"><div align="right">CNPJ:</div></td>		 <td> </td>		 <td height="20" colspan="2"><font face="Verdana" size="2" color="#003300"><strong><font face="Verdana" size="2" color="#003300"><strong>		   <input name="txtCnpj" type="text" class="style3" id="txtCnpj" size="40" />		 </strong></font></strong></font></td>	   </tr>	   <tr>		 <td height="20"><div align="right">E-mail:</div></td>		 <td> </td>		 <td height="20" colspan="2"><input name="txtEmail" type="text" class="style3" id="txtEmail" size="40" /></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Endereço:</div></td>		 <td> </td>		 <td height="20" colspan="2"><input name="txtEndereco" type="text" class="style3" id="txtEndereco" size="40" /></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Bairro:</div></td>		 <td> </td>		 <td height="20" colspan="2"><input name="txtBairro" type="text" class="style3" id="txtBairro" size="40" /></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Cidade:</div></td>		 <td> </td>		 <td height="20" colspan="2"><input name="txtCidade" type="text" class="style3" id="txtCidade" size="40" /></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Estado:</div></td>		 <td> </td>		 <td height="20" colspan="2"><font face="Verdana" size="2" color="#003300"><strong><font face="Verdana" size="2" color="#003300"><strong>		   <select name="cbEstado" size="1" class="style3" id="cbEstado">			 <option selected="selected" value="0">Escolha</option>			 <option value="AC">AC</option>			 <option value="AL">AL</option>			 <option value="AM">AM </option>			 <option value="BA">BA </option>			 <option value="CE">CE </option>			 <option value="DF">DF </option>			 <option value="ES">ES </option>			 <option value="GO">GO </option>			 <option value="MA">MA</option>			 <option value="MG">MG </option>			 <option value="MS">MS </option>			 <option value="MT">MT </option>			 <option value="PA">PA </option>			 <option value="PA">PB </option>			 <option value="PE">PE</option>			 <option value="PI">PI </option>			 <option value="PR">PR </option>			 <option value="RJ">RJ </option>			 <option value="RO">RO </option>			 <option value="RN">RN </option>			 <option value="RS">RS </option>			 <option value="RR">RR </option>			 <option value="SC">SC </option>			 <option value="SE">SE </option>			 <option value="SP">SP </option>			 <option value="TO">TO </option>		   </select>		 </strong></font></strong></font></td>	   </tr>	   <tr>		 <td height="20"><div align="right">Telefone:</div></td>		 <td> </td>		 <td height="20" colspan="2"><input name="txtFone" type="text" class="style3" id="txtFone" size="40" /></td>	   </tr>	   <tr>		 <td height="20"> </td>		 <td> </td>		 <td height="20" colspan="2"> </td>	   </tr>	   <tr>		 <td height="20"> </td>		 <td> </td>		 <td width="95" height="20">Produto:</td>		 <td width="127" height="20">Quantidade:</td>		 </tr>	   <tr>		 <td height="20"><div align="right"></div></td>		 <td> </td>		 <td height="20"><font face="Verdana" size="2" color="#003300">		   <input name="txtProd01" type="text" class="style3" id="txtProd01" size="20" />		   </font></td>		 <td><font face="Verdana" size="2" color="#003300">		   <input name="txtQtd01" type="text" class="style3" id="txtQtd01" size="10" />		 </font></td>		 </tr>		</tbody>	 </table>   </div>   </form>   <input name="Submit" type="submit" class="style3" value="Adicionar mais produtos" onclick="java script:campo();" />   <input name="Submit" type="submit" class="style3" value="Enviar" />   </td>   <td><img name="empresa_r2_c5" src="images/empresa_r2_c5.jpg" width="88" height="153" border="0" id="empresa_r2_c5" alt="" /></td>   <td colspan="2" background="images/empresa_r2_c6.jpg"><div align="justify">	 <img name="empresa_r1_c6" src="images/pedido_r2_c6.jpg" width="271" height="153" border="0" id="empresa_r1_c6" alt="" />   </div></td>   <td><img src="images/spacer.gif" width="1" height="153" border="0" alt="" /></td>  </tr>  <tr>   <td rowspan="3"><img name="empresa_r3_c5" src="images/empresa_r3_c5.jpg" width="88" height="199" border="0" id="empresa_r3_c5" alt="" /></td>   <td rowspan="2"><script type="text/javascript">AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0','width','180','height','177','src','flash/menu_interno','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','flash/menu_interno' ); //end AC code</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="180" height="177">	 <param name="movie" value="flash/menu_interno.swf" />	 <param name="quality" value="high" />	 <embed src="flash/menu_interno.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="177"></embed>   </object></noscript></td>   <td rowspan="4" colspan="2"><img name="empresa_r3_c7" src="images/empresa_r3_c7.jpg" width="147" height="231" border="0" id="empresa_r3_c7" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="67" border="0" alt="" /></td>  </tr>  <tr>   <td rowspan="3"><img name="empresa_r4_c1" src="images/empresa_r4_c1.jpg" width="48" height="164" border="0" id="empresa_r4_c1" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="110" border="0" alt="" /></td>  </tr>  <tr>   <td rowspan="2"><img name="empresa_r5_c6" src="images/empresa_r5_c6.jpg" width="180" height="54" border="0" id="empresa_r5_c6" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="22" border="0" alt="" /></td>  </tr>  <tr>   <td colspan="4"><img name="empresa_r6_c2" src="images/empresa_r6_c2.jpg" width="387" height="32" border="0" id="empresa_r6_c2" alt="" /></td>   <td><img src="images/spacer.gif" width="1" height="32" border="0" alt="" /></td>  </tr>  <tr>   <td rowspan="2" colspan="2"><img name="empresa_r7_c1" src="images/empresa_r7_c1.jpg" width="161" height="132" border="0" id="empresa_r7_c1" alt="" /></td>   <td colspan="3"><img name="empresa_r7_c3" src="images/empresa_r7_c3.jpg" width="274" height="96" border="0" id="empresa_r7_c3" alt="" /></td>   <td><img name="empresa_r7_c6" src="images/empresa_r7_c6.jpg" width="180" height="96" border="0" id="empresa_r7_c6" alt="" /></td>   <td colspan="2" valign="top" bgcolor="#cccccc"><p style="margin:0px"><img name="index_r7_c9" src="images/interno_r7_c7.jpg" width="147" height="96" border="0" id="index_r7_c9" alt="" /></p></td>   <td><img src="images/spacer.gif" width="1" height="96" border="0" alt="" /></td>  </tr>  <tr>   <td colspan="4" valign="middle" background="images/index_r9_c3.jpg" bgcolor="#cccccc"><table width="100%"  border="0" cellspacing="0" cellpadding="0">	 <tr>	   <td><div align="center" class="style1">Casa Narciso - Matriz: Rua Cel. Córdova, 91 - Filial: Rua Cel. Serafim de Moura, 185 - (49) 3221-7400</div></td>	 </tr>   </table>	 <p style="margin:0px"></p></td>   <td colspan="2" valign="top" bgcolor="#cccccc"><p style="margin:0px"><a href="http://www.arenadesign.com.br" target="_blank"><img name="index_r9_c9" src="images/interno_r8_c7.jpg" width="147" height="36" border="0" id="index_r9_c9" alt="" /></a></p></td>   <td><img src="images/spacer.gif" width="1" height="36" border="0" alt="" /></td>  </tr></table></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Opa, beleza.Dê uma olhadinha e veja se pode te ajudar<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=windows-1252"><META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD><BODY><script language=JavaScript><!--var expDays = 30;var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000));var ShowCount = 0;var SwapColour;function ListToDoItems() {var NumToDoItems = GetCookie('PT_NumToDoList');var i;var ToDoItem;if (NumToDoItems == null) {NumToDoItems = 0;}ShowCount = 0; SwapColour = 0;for (i=1; i <= NumToDoItems; i++) {ToDoItem = GetCookie('PT_ToDoItem'+i);if (ToDoItem != null) {PrintItem(ToDoItem, i); } }}function DeleteItem(Count) {DeleteCookie('PT_ToDoItem'+Count);window.location = window.location;}function PrintItem (ToDoItem, Count) {var color = "";SwapColour = 1 - SwapColour;if (SwapColour==1) {color = "bgcolor='#ffffff'"} ;ShowCount++;document.write("<tr " + color + ">");document.write("<td width=10% align=center valign=top><small><b>"+ShowCount);document.write("<td width=75% align=left ><small>"+ToDoItem);document.write("<td width=15% align=center><small>"+"<a href='java script:DeleteItem(" + Count + ")'><font color=#ffcccc face=verdana size=1>Delete</a>");}function AddItem() {var NumToDoItems = GetCookie('PT_NumToDoList');var i;var ToDoItem;if (NumToDoItems == null) {NumToDoItems = 0;}ToDoItem = prompt("Entre com um novo item.");if ((ToDoItem != null) && (ToDoItem != "undefined" )) {NumToDoItems++;SetCookie('PT_ToDoItem'+NumToDoItems, ToDoItem, exp);SetCookie('PT_NumToDoList',NumToDoItems, exp);window.location = window.location; }}function set() {VisitorName = prompt("Qual seu nome?");SetCookie ('VisitorName', VisitorName, exp);SetCookie ('WWHCount', 0, exp);SetCookie ('WWhenH', 0, exp);}function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr));}function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null;}function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");}function DeleteCookie (name) { var exp = new Date(); exp.setTime (exp.getTime() - 1); var cval = GetCookie (name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();}// --></SCRIPT><TABLE width="100%"> <script language=JavaScript><!-- ListToDoItems();// --></SCRIPT> <TBODY></TBODY></TABLE><CENTER><A href="java script:AddItem()"><FONT face=verdana color=black size=1>adicionar item</FONT></A></CENTER></BODY></HTML>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.