-2

Account Code is not displaying correctly in input "type=number" in mozila firefox.it is working properly in chrome. this is only happening when code is getting greater than or equal to 17 digits.

Your Answer will be appreciated

enter image description here

GordonM
  • 31,179
  • 15
  • 87
  • 129
  • Welcome to Stack Overflow! Please take the [tour](http://stackoverflow.com/tour), have a look around, and read through the [help center](http://stackoverflow.com/help), in particular [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) Make an effort to solve the problem. If you run into a specific issue doing so, post a question with your attempt (the JavaScript code using jQuery), saying what isn't working, and explaining your research so far. – Rory McCrossan Mar 22 '17 at 09:46
  • Could you show us what you have been done so far?? – Pramod Patil Mar 22 '17 at 09:50
  • Define "Not working properly". Also, this is clearly a client-side issue and therefore nothing to do with PHP. – GordonM Mar 22 '17 at 09:57
  • @Pramod Patil I have used substr functions of php to get last 4 digits and increment + 1 in it and then show in html thorough jquery – Hammad Younus Mar 22 '17 at 10:02
  • @GordonM I mean code is not displaying according to need you can se in developer tool json is returning correct code "new_ID" it should be shown in text box but it is adding 0000 to last 4 digits instead of 0002 This is displaying properly in Chrome but doing problem in mozila firefox – Hammad Younus Mar 22 '17 at 10:11
  • Come on, people. The original unedited post had all information needed to spot the problem immediately. Don't just go and downvote any post of a new member. – GertG Mar 23 '17 at 09:03

1 Answers1

0

Your numbers are just too big for <input type="number">. Quoting a Mozilla developer from this bug report:

Your values exceed the maximum 53-bits that can safely be represented as an integer in a IEEE 754 double-precision floating-point. Max value before rounding is 9007199254740991. This is expected behavior.

So it looks like you won't be able to use <input type="number">. If you want to limit the allowed characters to digits in a normal text input, this thread might help.

Edit: The discussion in this other, active bug report might indicate that FF will at one point change its mind and use the original string value - not the converted number - for presentation, like I suppose Chrome does.

Community
  • 1
  • 1
GertG
  • 959
  • 1
  • 8
  • 21