Ir para conteúdo

POWERED BY:

Arquivado

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

Webmater Felipe Edwards

Codigo dificil de decifrar

Recommended Posts

Olá pessoal,

 

 

Tenho um script javascript que é uma função na qual serve para adicionar mais campos(campo nserie) ao formulário toda vez que clicado no botão "+" e acrescenta mais um numero no campo anterior.

 

Se digito 9001 e logo em seguida clico em "+"

ele adiciona 9002 e cria um novo campo logo abaixo.

 

O grande problema e que preciso que ele crie o novo campo juntamente com o valor digitado anteriormente da seguinte maneira.

 

o campo "nserie" ao receber dados 9001 e logo em seguida quando eu pressionar o botão "+"

ele cria o campo "nserie2" verifique o que foi digitado no campo "nserie" e acrescente mais 1(90020, e assim sucessivamente.

 

Vale lembrar que o campo tem que ter o seu id nserie2 e assim sucessivamente para cada campo criado o nserie3 nserie4 e etc.

 

o codigo é o que postei abaixo.

-----------------------------------------------------------------------------------------------------------

  function inserircampo() {
                       var obj = document.createElement("input");
                       obj.setAttribute("type","text");
                       obj.setAttribute("id","novo_campo");
                       obj.setAttribute("maxLenght","9");
                       obj.setAttribute('value','');
			    	var td = document.getElementById("meu_campo");
                       td.insertBefore(obj);

 

-----------------------------------------------------------------------------------------------------------

Compartilhar este post


Link para o post
Compartilhar em outros sites

no elemento meu_campo, você procura pelos inputs e pega o último.

function inserecampo() {
   "use strict";
   var target, index, list, newobj;
   target  = document.getElementById('meu_campo');
   newobj  = document.createElement('input');
   list    = target.getElementsByTagName('input');
   index   = list.length;
   newobj.setAttribute('value', '');
   newobj.setAttribute('type', 'text');
   newobj.setAttribute('name', 'campo' + index);
   newobj.setAttribute('maxlength', 9);
   newobj.setAttribute('id', newobj.getAttribute('name'));
   if (index) {
       newobj.setAttribute('value', list[index - 1].getAttribute('value'));
   }
   target.appendChild(newobj);
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

no elemento meu_campo, você procura pelos inputs e pega o último.

function inserecampo() {
   "use strict";
   var target, index, list, newobj;
   target  = document.getElementById('meu_campo');
   newobj  = document.createElement('input');
   list    = target.getElementsByTagName('input');
   index   = list.length;
   newobj.setAttribute('value', '');
   newobj.setAttribute('type', 'text');
   newobj.setAttribute('name', 'campo' + index);
   newobj.setAttribute('maxlength', 9);
   newobj.setAttribute('id', newobj.getAttribute('name'));
   if (index) {
       newobj.setAttribute('value', list[index - 1].getAttribute('value'));
   }
   target.appendChild(newobj);
}

 

 

Olá Evandro obrigado por responder,

 

O script que me forneceu é seguindo essa lógica mesmo porém o que me passou está adicionando o simbolo de "+" toda vez que eu clico em +.

O correto seria ele adicionar o valor que digitei no primeiro campo (9001) acrescido de +1(9002)

ou seja, toda vez que eu clicar em "+" e tiver digitado 9001 ou qualquer número, no segundo campo que ele criar ele deverá adicionar o valor anterior digitado acrescido de +1.

 

Fiquei muito grato pela resposta, aguardo sua resposta, será um alivio para mim resolver esse problemão que já vai fazer meses.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá Evandro obrigado por responder,

 

O script que me forneceu é seguindo essa lógica mesmo porém o que me passou está adicionando o simbolo de "+" toda vez que eu clico em +.

O correto seria ele adicionar o valor que digitei no primeiro campo (9001) acrescido de +1(9002)

ou seja, toda vez que eu clicar em "+" e tiver digitado 9001 ou qualquer número, no segundo campo que ele criar ele deverá adicionar o valor anterior digitado acrescido de +1.

 

Fiquei muito grato pela resposta, aguardo sua resposta, será um alivio para mim resolver esse problemão que já vai fazer meses.

 

Trabalhe com o value ou expressões regulares.

 

na segunda linha, troque

var target, index, list, newobj;

por

var target, index, list, newobj, newval;

 

dentro de

if (index) {

será necessário verificar se o valor é numérico para então acrescê-lo de 1.

 

newval = parseInt(list[index - 1].getAttribute('value'), 10);
newobj.setAttribute('value', newval + 1);

Compartilhar este post


Link para o post
Compartilhar em outros sites

Trabalhe com o value ou expressões regulares.

 

na segunda linha, troque

var target, index, list, newobj;

por

var target, index, list, newobj, newval;

 

dentro de

if (index) {

será necessário verificar se o valor é numérico para então acrescê-lo de 1.

 

newval = parseInt(list[index - 1].getAttribute('value'), 10);
newobj.setAttribute('value', newval + 1);

 

E ai Evandro beleza ^^? Espero que sim Brother

deixa eu lhe falar vou postar o codigo aqui para você verficar , não está dando certo ta toda hora aparecendo uma mensagem NaN todas as vezes que clico em "+".

Segue o codigo abaixo com as modificações que fiz.

--------------------------------------------------------------------------------------------------------------------

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- abre jquery que adiciona + campos ao nserie -->

<!-- inseri mais campos de número de série-->
<script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script type="text/javascript">
                       function inserircampo() {
                       var obj = document.createElement("input");
                       obj.setAttribute("type","text");
                       obj.setAttribute("id","novo_campo");
                       obj.setAttribute("maxLenght","9");
                       obj.setAttribute('value','');
				    var td = document.getElementById("meu_campo");
                       td.insertBefore(obj);
				    //

}
function inserecampo() {
   "use strict";
   var target, index, list, newobj, newval;
   target  = document.getElementById('meu_campo');
   newobj  = document.createElement('input');
   list    = target.getElementsByTagName('input');
   index   = list.length;
   newobj.setAttribute('value', '');
   newobj.setAttribute('type', 'text');
   newobj.setAttribute('name', 'campo' + index);
   newobj.setAttribute('maxlength', 9);
   newobj.setAttribute('id', newobj.getAttribute('name'));
   if (index) {
       newobj.setAttribute('value', list[index - 1].getAttribute('value'));
	newval = parseInt(list[index - 1].getAttribute('value'), 10);
newobj.setAttribute('value', newval + 1)
   }
   target.appendChild(newobj);
}

function inserircampo2(){
   campo=document.getElementById('nserie');
   zeros=campo.value.match(/^0*/)[0];
   valor=parseInt(campo.value,10);
   valor2=valor+1;
   if((valor+"").length<(valor2+"").length)campo.value=zeros.substr(0,zeros.length-1)+valor2;
   else campo.value=zeros+valor2;
}
         </script>     


<!-- fim do script de inserir novos campos ao numero de série -->
<link rel=”stylesheet” type=”text/css” href=”calendario.css” />
<script src="calendario.js" > </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gerador de senhas</title>

<style type="text/css">
<!--
.style3 {font-size: 11px; font-family: Geneva, Arial, Helvetica, sans-serif; }
.style5 {
font-size: 10px;
font-family: Geneva, Arial, Helvetica, sans-serif;
color: #FF0000;
}
-->
</style>
<link href="calendario.css" rel="stylesheet" type="text/css" media="all" />
<link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
 <table width="355" border="0" align="center">
   <tr>
     <td width="100" class="style3"><span class="style3">Equipamento:</span></td>
     <td width="245"><select name="equipamento" id="equipamento">
       <option value="TSW200E1">TSW200E1</option>
       <option value="TSW800TP">TSW800TP</option>
       <option value="TSW900ETH">TSW900ETH</option>
       <option value="TSW300TIM">TSW300TIM</option>
       <option value="TSW400DSL">TSW400DSL</option>
       <option value="TSW110OPM">TSW110OPM</option>
     </select>      </td>
   </tr>
       <tr>
     <td bgcolor="#CCCCCC" class="style3">N. de série:</td>
     <td bgcolor="#CCCCCC" id="meu_campo"><span id="sprytextfield1">
       <input name="nserie" type="text" id="nserie" maxlength="9" />
       <span class="textfieldRequiredMsg">*</span></span>
       <input type="button" name="button2" id="button2" value="+" onclick="javascript:inserecampo();" /></td>
   </tr>
   <tr>
     <td class="style3">Cliente:</td>
     <td><input name="cliente" type="text" id="cliente" maxlength="9" /></td>
   </tr>
   <tr>
     <td class="style3">Pedido:</td>
     <td><input name="pedido" type="text" id="textfield15" maxlength="9" /></td>
   </tr>
       <tr>
     <td class="style3">Nota:</td>
     <td><input name="nota" type="text" id="textfield14" maxlength="9" /></td>
   </tr>
       <tr>
         <td class="style3">Data de emissão:</td>
         <td><span id="pop2" style="position:absolute"></span><input name="data_emissao" type="text" id="textfield4" size="15" maxlength="9" />
         <input TYPE="button" NAME="btnData2" VALUE="..." Onclick="javascript:popdate('document.form1.data_emissao','pop2','150',document.form1.data_emissao.value)"> </td>
       </tr>

   <tr>
     <td class="style3">Parcela1:</td>
     <td><select name="parcela1" id="parcela1">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
       <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela2:</td>
     <td><select name="parcela2" id="parcela2">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela3:</td>
     <td><select name="parcela3" id="parcela3">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela4:</td>
     <td><select name="parcela4" id="parcela4">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
<span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela5:</td>
     <td><select name="parcela5" id="parcela5">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela6:</td>
     <td><select name="parcela6" id="parcela6">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3"> </td>
     <td> </td>
   </tr>
   <tr>
     <td class="style3">Senha1:</td>
     <td><input name="senha1" type="text" id="textfield8" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha2:</td>
     <td><input name="senha2" type="text" id="textfield9" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha3:</td>
     <td><input name="senha3" type="text" id="textfield10" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha4:</td>
     <td><input name="senha4" type="text" id="textfield11" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha5:</td>
     <td><input name="senha5" type="text" id="textfield12" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha6:</td>
     <td><input name="senha6" type="text" id="textfield13" maxlength="6" /></td>
   </tr>
 </table>
 <p> </p>
 <table width="361" border="0" align="center">
   <tr>
     <td align="center"><input type="submit" name="button" id="button" value="Cadastrar Liberação no aparelho" /></td>
   </tr>
 </table>

 <input type="hidden" name="MM_insert" value="form1" />
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {hint:"N\xFAmero de s\xE9rie"});
//-->
</script>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

O problema é que o botão [+] também é um INPUT

 

troque

<input type="button" name="button2" id="button2" value="+" onclick="javascript:inserecampo();" />

por

<button type="button" name="button2" id="button2" onclick="inserecampo();">+</button>

 

troque, também a linha onde contém

newval = parseInt(list[index - 1].getAttribute('value'), 10);

por

newval = parseInt(list[index - 1].value, 10);

Compartilhar este post


Link para o post
Compartilhar em outros sites

O problema é que o botão [+] também é um INPUT

 

troque

<input type="button" name="button2" id="button2" value="+" onclick="javascript:inserecampo();" />

por

<button type="button" name="button2" id="button2" onclick="inserecampo();">+</button>

 

troque, também a linha onde contém

newval = parseInt(list[index - 1].getAttribute('value'), 10);

por

newval = parseInt(list[index - 1].value, 10);

 

isso ta dificil, que codigo chato pra caramba mano rs,

agora ta dando "Null" nos campos que são criados, mas alguma ideia ai jow ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Brother tentei tentei e não deu certo,

ele cria o outro campo mas cria com o nome Null dentro da area de texto.

 

Sei que posso estar sendo chato, mas sou novo com PHP ainda e não tenho tanto conhecimento por isso que venho implorar ajuda rs.

 

tem outra solução ai ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

posta denovo todo o código. Pode ter ficado alguma modificação por fazer no meio do caminho.

<?php require_once('../../Connections/gerador.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
 $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

 $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

 switch ($theType) {
   case "text":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;    
   case "long":
   case "int":
     $theValue = ($theValue != "") ? intval($theValue) : "NULL";
     break;
   case "double":
     $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
     break;
   case "date":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;
   case "defined":
     $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
     break;
 }
 return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
 $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
 $insertSQL = sprintf("INSERT INTO geradorkey (nserie, nserie2, nserie3, parcela1, parcela2, parcela3, parcela4, parcela5, parcela6, equipamento, pedido, nota, cliente, senha1, senha2, senha3, senha4, senha5, senha6, data_emissao) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                      GetSQLValueString($_POST['nserie'], "text"),
				   GetSQLValueString($_POST['nserie2'], "text"),
				   GetSQLValueString($_POST['nserie3'], "text"),
                      GetSQLValueString($_POST['parcela1'], "text"),
                      GetSQLValueString($_POST['parcela2'], "text"),
                      GetSQLValueString($_POST['parcela3'], "text"),
                      GetSQLValueString($_POST['parcela4'], "text"),
                      GetSQLValueString($_POST['parcela5'], "text"),
                      GetSQLValueString($_POST['parcela6'], "text"),
                      GetSQLValueString($_POST['equipamento'], "text"),
                      GetSQLValueString($_POST['pedido'], "text"),
                      GetSQLValueString($_POST['nota'], "text"),
                      GetSQLValueString($_POST['cliente'], "text"),
                      GetSQLValueString($_POST['senha1'], "text"),
                      GetSQLValueString($_POST['senha2'], "text"),
                      GetSQLValueString($_POST['senha3'], "text"),
                      GetSQLValueString($_POST['senha4'], "text"),
                      GetSQLValueString($_POST['senha5'], "text"),
                      GetSQLValueString($_POST['senha6'], "text"),
                      GetSQLValueString($_POST['data_emissao'], "text"));

 mysql_select_db($database_gerador, $gerador);
 $Result1 = mysql_query($insertSQL, $gerador) or die(mysql_error());

 $insertGoTo = "cadastrado.php";
 if (isset($_SERVER['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
   $insertGoTo .= $_SERVER['QUERY_STRING'];
 }
 header(sprintf("Location: %s", $insertGoTo));
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- abre jquery que adiciona + campos ao nserie -->

<!-- inseri mais campos de número de série-->
<script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script type="text/javascript">
                       function inserircampo() {
                       var obj = document.createElement("input");
                       obj.setAttribute("type","text");
                       obj.setAttribute("id","novo_campo");
                       obj.setAttribute("maxLenght","9");
                       obj.setAttribute('value','');
				    var td = document.getElementById("meu_campo");
                       td.insertBefore(obj);
				    //

}
function inserecampo() {
   "use strict";
   var target, index, list, newobj, newval;
   target  = document.getElementById('meu_campo');
   newobj  = document.createElement('input');
   list    = target.getElementsByTagName('input');
   index   = list.length;
   newobj.setAttribute('value', '');
   newobj.setAttribute('type', 'text');
   newobj.setAttribute('name', 'campo' + index);
   newobj.setAttribute('maxlength', 9);
   newobj.setAttribute('id', newobj.getAttribute('name'));
   if (index) {
   newobj.setAttribute('value', newval + 1);
   newobj.setAttribute('value', list[index - 1].getAttribute('value'));
   newval = parseInt(list[index - 1].value, 10) || 0;
}

}

function inserircampo2(){
   campo=document.getElementById('nserie');
   zeros=campo.value.match(/^0*/)[0];
   valor=parseInt(campo.value,10);
   valor2=valor+1;
   if((valor+"").length<(valor2+"").length)campo.value=zeros.substr(0,zeros.length-1)+valor2;
   else campo.value=zeros+valor2;
}
         </script>     


<!-- fim do script de inserir novos campos ao numero de série -->
<link rel=”stylesheet” type=”text/css” href=”calendario.css” />
<script src="calendario.js" > </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gerador de senhas</title>

<style type="text/css">
<!--
.style3 {font-size: 11px; font-family: Geneva, Arial, Helvetica, sans-serif; }
.style5 {
font-size: 10px;
font-family: Geneva, Arial, Helvetica, sans-serif;
color: #FF0000;
}
-->
</style>
<link href="calendario.css" rel="stylesheet" type="text/css" media="all" />
<link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
 <table width="355" border="0" align="center">
   <tr>
     <td width="100" class="style3"><span class="style3">Equipamento:</span></td>
     <td width="245"><select name="equipamento" id="equipamento">
       <option value="TSW200E1">TSW200E1</option>
       <option value="TSW800TP">TSW800TP</option>
       <option value="TSW900ETH">TSW900ETH</option>
       <option value="TSW300TIM">TSW300TIM</option>
       <option value="TSW400DSL">TSW400DSL</option>
       <option value="TSW110OPM">TSW110OPM</option>
     </select>      </td>
   </tr>
       <tr>
     <td bgcolor="#CCCCCC" class="style3">N. de série:</td>
     <td bgcolor="#CCCCCC" id="meu_campo"><span id="sprytextfield1">
       <input name="nserie" type="text" id="nserie" maxlength="9" />
       <span class="textfieldRequiredMsg">*</span></span>
       <button type="button" name="button2" id="button2" onclick="inserecampo();">+</button></td>
   </tr>
   <tr>
     <td class="style3">Cliente:</td>
     <td><input name="cliente" type="text" id="cliente" maxlength="9" /></td>
   </tr>
   <tr>
     <td class="style3">Pedido:</td>
     <td><input name="pedido" type="text" id="textfield15" maxlength="9" /></td>
   </tr>
       <tr>
     <td class="style3">Nota:</td>
     <td><input name="nota" type="text" id="textfield14" maxlength="9" /></td>
   </tr>
       <tr>
         <td class="style3">Data de emissão:</td>
         <td><span id="pop2" style="position:absolute"></span><input name="data_emissao" type="text" id="textfield4" size="15" maxlength="9" />
         <input TYPE="button" NAME="btnData2" VALUE="..." Onclick="javascript:popdate('document.form1.data_emissao','pop2','150',document.form1.data_emissao.value)"> </td>
       </tr>

   <tr>
     <td class="style3">Parcela1:</td>
     <td><select name="parcela1" id="parcela1">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
       <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela2:</td>
     <td><select name="parcela2" id="parcela2">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela3:</td>
     <td><select name="parcela3" id="parcela3">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela4:</td>
     <td><select name="parcela4" id="parcela4">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
<span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela5:</td>
     <td><select name="parcela5" id="parcela5">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3">Parcela6:</td>
     <td><select name="parcela6" id="parcela6">
       <option value="não">não</option>
       <option value="sim">sim</option>
       <option value="não possui">não possui</option>
     </select>
     <span class="style5">*Pago?</span></td>
   </tr>
   <tr>
     <td class="style3"> </td>
     <td> </td>
   </tr>
   <tr>
     <td class="style3">Senha1:</td>
     <td><input name="senha1" type="text" id="textfield8" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha2:</td>
     <td><input name="senha2" type="text" id="textfield9" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha3:</td>
     <td><input name="senha3" type="text" id="textfield10" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha4:</td>
     <td><input name="senha4" type="text" id="textfield11" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha5:</td>
     <td><input name="senha5" type="text" id="textfield12" maxlength="6" /></td>
   </tr>
   <tr>
     <td class="style3">Senha6:</td>
     <td><input name="senha6" type="text" id="textfield13" maxlength="6" /></td>
   </tr>
 </table>
 <p> </p>
 <table width="361" border="0" align="center">
   <tr>
     <td align="center"><input type="submit" name="button" id="button" value="Cadastrar Liberação no aparelho" /></td>
   </tr>
 </table>

 <input type="hidden" name="MM_insert" value="form1" />
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {hint:"N\xFAmero de s\xE9rie"});
//-->
</script>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Nossa, cara! Conseguiu complicar o que já estava pronto!!

 

troque estas três linhas

if (index) {
   newobj.setAttribute('value', newval + 1);
   newobj.setAttribute('value', list[index - 1].getAttribute('value'));
   newval = parseInt(list[index - 1].value, 10) || 0;
       }

 

por isso aqui

if (index) {
   newval = parseint(list[index - 1].value, 10) || 0;
   newobj.setAttribute('value', newval + 1);
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Nossa, cara! Conseguiu complicar o que já estava pronto!!

 

troque estas três linhas

if (index) {
   newobj.setAttribute('value', newval + 1);
   newobj.setAttribute('value', list[index - 1].getAttribute('value'));
   newval = parseInt(list[index - 1].value, 10) || 0;
       }

 

por isso aqui

if (index) {
   newval = parseint(list[index - 1].value, 10) || 0;
   newobj.setAttribute('value', newval + 1);
}

 

Olá Evandro como vai brother ? espero que tudo bem.

 

cara nesses últimos dias eu tentei tentei refiz tudo novamente não consegui será que existe alguma outra maneira ?

 

Criei um diretorio no meu site para você postar o codigo que você disse que tinha funcionado corretamente. Abaixo segue os dados de acesso a conta;

ftp.agenciacube.com

Login:evandro@agenciacube.com

senha:evandro123

Compartilhar este post


Link para o post
Compartilhar em outros sites

Servidor offline. Recomendo que tire estas informações de domínio público.

O que eu podia fazer para te ajudar já foi feito. Aguarde até que outros usuários postem novas sugestões.

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.