jQuery UI Widgets Forums Editors NumberInput Provide option to allow empty input and placeholder text

This topic contains 4 replies, has 2 voices, and was last updated by  fritzfrancis 9 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • fritzfrancis
    Participant

    I’ve noticed with the jqxNumberInput that there is no way to use placeholder text because (1) the input cannot be blank, only 0, and (2) a placeholder setting/property would have to be provided.

    On my page, I want to display to users a percentage representing a discount rate on a certain product. I also want to use jqxNumberInput to display a user’s “override” of that percentage. When the user saves the page, if the input has a value in it, that new discount percentage will be saved. But if the input is blank, then it does not make any changes. The inability to have the input be empty is preventing me from accomplishing this, and a placeholder saying something like “no override” or “none” would, in my case, be very useful.

    In the meantime, I am simply using an HTML5 <input type="number" placeholder="none" />, but I would love to use your widget if this functionality is ever added.

    Regards,
    Fritz Francis


    Hristo
    Participant

    Hello Fritz Francis,

    If I understand You correctly maybe this example will help.
    And if You prefer could make logic of button to be controlled by admin.
    Feel free to ask again.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    fritzfrancis
    Participant

    Hi Hristo,

    Thank you for the demo, but unfortunately I don’t see how it at all relates to placeholders or allowing the input to be empty. Perhaps I didn’t explain myself well.

    Consider this basic input element: <input type="number" placeholder="no value" />. It would be very nice if the jqxNumberInput could:
    1. Allow the input to be blank, rather than always containing a number.
    2. When blank, display placeholder text.

    Would you guys consider adding this ability in the future? I want to use your widget because of the many options it has, but can’t use it until it can do some of the basic things that a simple HTML5 number input can do.

    Thanks,
    Fritz Francis


    Hristo
    Participant

    Hi Fritz Francis,

    Please, take a look at this example.
    Thank you for this feedback.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    fritzfrancis
    Participant

    This is a pretty nice workaround! It doesn’t quite accomplish the same thing because resetting the “placeholder” value requires some event handlers, but this is close enough. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.