Ir para conteúdo
Fórum Script Brasil
  • 0

Validação Mobile - Meu código com vários erros


Martinsrj

Pergunta

Olá pessoal, boa tarde!

Venho aqui solicita ajuda na validação do meu código para mobile.

Segue o código:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
<title>Atualização de Chamado</title>

<style type="text/css">
label {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:11px;
    color:#000000;
}

input:focus, select:focus, textarea:focus {
    background:#DFDFFF;
    color:white; 
}

body { 
    margin:0; 
    padding:0; 
    background:#FFFFFF;  
} 

table.tabela {   
    /*width:200;
    text-align: center;   
    margin: 0 auto; */
}
</style>

<script type="text/javascript">
function addRowToTable()
{
  var tbl = document.getElementById('AtChamado');
  var lastRow = tbl.rows.length -1;
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  
  var cellRightSel = row.insertCell(0);
  var textTpDespesa = document.createTextNode("Tipo Despesa");
  var fontTpDespesa = document.createElement("label");
  var quebraTpDespesa = document.createElement('BR');
  var sel = document.createElement('select');
  var quebra = document.createElement('BR');
  sel.name = 'selRow' + iteration;
  sel.options[0] = new Option('... Selecione ...', '... Selecione ...');
  sel.options[1] = new Option('Kilometragem', 'Kilometragem');
  sel.options[2] = new Option('Taxi', 'Taxi');
  sel.options[3] = new Option('Onibus', 'Ônibus');
  sel.options[4] = new Option('Refeicao', 'Refeição');
  sel.options[5] = new Option('Outros', 'Outros');

  fontTpDespesa.appendChild(textTpDespesa); 
  cellRightSel.appendChild(fontTpDespesa); 
  cellRightSel.appendChild(quebraTpDespesa);
  
  cellRightSel.appendChild(sel);
  cellRightSel.appendChild(quebra);
  
  var textDesc = document.createTextNode("Descrição");
  var fontDesc = document.createElement("label");
  
  var quebraDesc = document.createElement('BR');
  var el = document.createElement('input');
  var quebra = document.createElement('BR');
  el.type = 'text';
  el.name = 'txtDescD' + iteration;
  el.id = 'txtDescD' + iteration;
  el.size = 10;
  
  el.onkeypress = keyPressTest;

  fontDesc.appendChild(textDesc); 
  cellRightSel.appendChild(fontDesc); 
  cellRightSel.appendChild(quebraDesc);
  cellRightSel.appendChild(el);
  cellRightSel.appendChild(quebra);

  var textValor = document.createTextNode("Valor");
  var fontValor = document.createElement("label");
  var quebraValor = document.createElement('BR');    
  var el = document.createElement('input');
  el.type = 'text';
  el.name = 'txtValorD' + iteration;
  el.id = 'txtValorD' + iteration;
  el.size = 10;  
  
  el.onkeypress = keyPressTest;

  fontValor.appendChild(textValor); 
  cellRightSel.appendChild(fontValor); 
  
  cellRightSel.appendChild(quebraValor);
  cellRightSel.appendChild(el);
   
}

function keyPressTest(e, obj)
{
  var validateChkb = document.getElementById('chkValidateOnKeyPress');
  if (validateChkb.checked) {
    var displayObj = document.getElementById('spanOutput');
    var key;
    if(window.event) {
      key = window.event.keyCode; 
    }
    else if(e.which) {
      key = e.which;
    }
    var objId;
    if (obj != null) {
      objId = obj.id;
    } else {
      objId = this.id;
    }
    displayObj.innerHTML = objId + ' : ' + String.fromCharCode(key);
  }
}
function removeRowFromTable()
{
  var tbl = document.getElementById('AtChamado');
  var lastRow = tbl.rows.length -1;
  if (lastRow > 13) tbl.deleteRow(lastRow - 1);
  
}

function verificaHP(obj) {  
    if (!document.layers) {  
    var txt = document.getElementById("somenteHP");  
        if (obj.value == "f_hp@ntl.com.br") {  
            txt.style.display = "inline";  
            txt.name = "optTipoChamado";  
            obj.name = "";  
        } 
        else {  
            txt.style.display = "none";  
            txt.name = "";  
            obj.name = "optTipoChamado";  
        }  
    } 
}        

</script>


</head>
<body>

<form action="formNtl.html" method="get">
<table class="tabela" id="AtChamado" align="left">
  <tr>
    <td>
    <label class="label" for="optTipoChamado">Tipo do Chamado:</label><br />
    <select name="optTipoChamado" id="optTipoChamado" onchange="verificaHP(this)">
        <option value="">... Selecione ...</option>
        <option value="f_hp@ntl.com.br">HP</option>
        <option value="f_altiris@ntl.com.br">NTL</option>
    </select>    </td>
  </tr>
  <tr>
    <td>
    <label for="txtChamadoAltiris" class="label">Chamado Altiris:</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtChamadoAltiris" id="txtChamadoAltiris" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtChamadoHP" class="label">Chamado HP:</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtChamadoHP" id="txtChamadoHP" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtDescServico" class="label">Descrição do Serviço:</label><br />
    <textarea title="" name="txtDescServico" id="txtDescServico" rows="5" cols="25" class="input"></textarea>    </td>
  </tr>
  <tr id="somenteHP" style="display:none;">  
    <td>
    <label for="txtPNRemovido" class="label">PN Removido:</label><br />
    <input class="input" type="text" title="" maxlength="" size="" name="txtPNRemovido" id="txtPNRemovido" value="" />    
    <br />
    <label for="txtNSRemovido" class="label">N/S Removido</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtNSRemovido" id="txtNSRemovido" value="" />
    <br />
    <label for="txtPNInstalado" class="label">PN Instalado:</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtPNInstalado" id="txtPNInstalado" value="" />
    <br />
    <label for="txtNSInstalado" class="label">N/S Instalado</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtNSInstalado" id="txtNSInstalado" value="" />
    
    </td>
  </tr>
  <tr>
    <td>
    <label for="txtQAssRS" class="label">Quem assinou o RS</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtQAssRS" id="txtQAssRS" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtRS" class="label">RS</label><br />
        <input class="input" type="text" title="" maxlength="" size="" name="txtRS" id="txtRS" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtDtInicio" class="label">Data Inicio</label><br />
    <input class="input" type="text" title="" maxlength="" size="" name="txtDtInicio" id="txtDtInicio" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtHrInicio" class="label">Hora Inicio</label><br />
    <input class="input" type="text" title="" maxlength="" size="" name="txtHrInicio" id="txtHrInicio" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtDtTermino" class="label">Data Término</label><br />
    <input class="input" type="text" title="" maxlength="" size="" name="txtDtTermino" id="txtDtTermino" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label for="txtDtTermino" class="label">Hora Término<br /></label>
    <input class="input" type="text" title="" maxlength="" size="" name="txtDtTermino" value="" />    </td>
  </tr>
  <tr>
    <td>
    <label class="label" id="txtReembolso"><b>Reembolso</b></label>    </td>
  </tr>
  <tr>
    <td>
        <label for="optTpDesp" class="label">Tipo Despesa </label>
    <br />
    <select name="optTpDesp" id="optTpDesp">
        <option value="">... Selecione ...</option>
        <option value="Kilometragem">Kilometragem</option>
        <option value="Taxi">Taxi</option>
        <option value="Onibus">Ônibus</option>
        <option value="Refeicao">Refeição</option>
        <option value="Outros">Outros</option>
     </select><br />
     
     <label for="txtDesc" class="label" onKeyPress="keyPressTest(event, this);">Descrição</label><br />
    <input class="input" type="text" title="" maxlength="" size="10" onKeyPress="keyPressTest(event, this);" name="txtDesc" id="txtDesc" value="" /><br />
    
    <label for="txtValor" class="label" onKeyPress="keyPressTest(event, this);">Valor</label><br />
    <input class="input" type="text" title="" maxlength="" size="10" onKeyPress="keyPressTest(event, this);" name="txtValor" id="txtValor" value="" />
        
    </td>
  </tr>
  
  <tr>
    <td align="left">
    <input type="button" value="Inserir" onclick="addRowToTable();" />
    <input type="button" value="Remover" onclick="removeRowFromTable();" /><br />
    <input name="Enviar" type="submit" id="Enviar" value="Enviar" />    
    </td>
  </tr>
</table>

</form>


</body>
</html>

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...