Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

436
Visualizações
How to finally submit a text string from an input box type=number?

How can I send the value shown in an HTML input box as '030.34' and not '0.34'? I need to prepend '03'for an ID.

I need the input box to be type 'number' so the up down buttons can be used, so I cannot set it to text.

Added: there are limits max min set on the input.

Any ideas? Thanks Chris

function ipFunction() {
  var c = SETPOINT.value;
  SETPOINT.value = xxx + c; // prepend '03' HOW???
  return true; // can be submitted 
}
<form id="frmSetPoint" name="frmSetPoint" action="#" onsubmit="ipFunction()" accept-charset="utf-8">
  <input type="number" onkeydown="return false" id="SETPOINT" name="SETPOINT" min="1" max="10">
  <input type="submit" value="Submit Value">
</form>

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

I spent a day on this - I'm just learning - but a friend put me right. Hopefully this should help others.

$("#frmSetPoint").validate({
       submitHandler: function (form) {
 var serializedData = $(form).serialize();
     serializedData = serializedData.replace("=", "='P03") + "'";

                    $.ajax({

                        url: '/value.cgi',

                        data: serializedData,

                        type: 'GET',

                        success: function (data) {                

},

  error: function (data) {
                                              
$(currentButton).prop('disabled', false);
$(currentButton).css({
color: '#ffffff',                                                                                                                                                                                                                                     
                                                                                                          
backgroundColor: '#00FF00'
});
}
});

return false;
}
}); //validate    
        
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda