Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

424
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda