Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

438
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!