Issue: Mouse Wheel Up and Down changes the value in a field

Discussion in 'HTML & Website Design' started by fullylucky, Apr 12, 2020.

  1. #1
    hey I have a php website platform. On certain pages there's fields where user can enter values into. Critical amounts with 2 decimal points...

    I am finding if the mouse is in a certain positional and if the mouse wheel scrolls up or down it is able to change the value of the 2 decimal point amount!!!

    This is a big risk for data input.

    Just wondering is there a way to disable or get rid of this for all users that visit the website?
     
    fullylucky, Apr 12, 2020 IP
  2. hdewantara

    hdewantara Well-Known Member

    Messages:
    538
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #2
    FYI, it is normal for a focused <input> element of type "number" to behave like this.
    have an URL link to one of the pages where I could see this?
     
    hdewantara, Apr 12, 2020 IP
  3. fullylucky

    fullylucky Well-Known Member

    Messages:
    40
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    108
    #3
    I have emailed you.
     
    fullylucky, Apr 12, 2020 IP
  4. hdewantara

    hdewantara Well-Known Member

    Messages:
    538
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #4
    Yes it is a number type input and seems to be acting its default behavior :)
    Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

    Simple way is by changing its type from "number" to "text" I guess. But then your users won't be able to increase / decrease number with up / down keys.
     
    hdewantara, Apr 12, 2020 IP
  5. fullylucky

    fullylucky Well-Known Member

    Messages:
    40
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    108
    #5
    ahhhh :'(

    Why do programmers or managers always wanna change the product. if someone is good and works don't "fix" it

    like I like windows 7. why change it looks bad windows 10. same with this.

    I never asked for this feature. who thought in their mind this was a needed feature of letting people scroll the mouse up and down. That's for scrolling the web page not the value within a field!! :'(
     
    fullylucky, Apr 12, 2020 IP
  6. hdewantara

    hdewantara Well-Known Member

    Messages:
    538
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #6
    this has history as far as I can remember.
    people asked for up / down feature for traditional text input and browsers answered with number type input.
    coders just need to adapt, haha :)
     
    hdewantara, Apr 12, 2020 IP