I have three different forms of inputs, lets say that one is currency as in $dollars the other is an ip address and the third is a date

The user will have to enter either one of these inputs in a textbox.

What is the recommended way to manage the format of this textbox? Note: the textbox will also change its appearance depending on which format was selected. i.e for a dollar it will put in the $ in front, for a ip address it will have 4 spaces with . separated.

I thought of using 3 radio buttons and 3 textboxes to select the textbox that the user wants. A combobox with the different formats also seems okay, but im not sure which one or if there are other controls to use.

  • I wasnt aware of that, is there a way to move this post there? (Without copying + pasting?) – user1932405 Apr 29 '14 at 12:09
  • 1
    you can try to flag your question for moderator attention, and ask if they will do that for you – igor milla Apr 29 '14 at 12:24
  • What is the context of this textfield? How, as a user, do I know that these 3 items can be in a single textfield; or do I? Does it not make sense to have a date and IP at the same time? – Evil Closet Monkey Oct 6 '14 at 22:01
  • @EvilClosetMonkey well the idea was that there are 3 related but mutually exclusive fields, what is the best practice way to display them? – user1932405 Oct 7 '14 at 8:11

I don't know what language you are writing this in, as you have not specified this, but in most cases there should be very many ways of doing this.

You could have a radio button (or dropdown) which would select the type of input the user wants, and modify the textbox accordingly. So if they select currency, they get a textbox with a $ in front. If they select IP address, they get a textbox split into 4, like you said.

In my opinion, this is the neatest way, and still simple to do. You just need a listener on the radio buttons or dropdown, and when the user changes his/her selection, the format of the textbox changes. The looks and format of a textbox displayed on screen can be easily changed in most popular programming languages.

You could also do what you said, and have 3 radio buttons and 3 textboxes which are enabled depending on which radio button is selected, but that can look less appealing to the user and possibly even confuse them unnecessarily.

  • The approach I took was to avoid changing the UI in front of the user by implementing the functionality in a wizard where on the prior screen you would select what the format would be "Add a bill", "Add a network device", "Add an appointment" which is more user centric. – user1932405 May 14 '14 at 11:48
  • Yeah that would work too, you would then probably just have 3 separate UIs (with possibly some code sharing) which you would call accordingly to the user selection. What language are you doing this in? – Illidanek May 14 '14 at 12:27
  • I dont have an implementation yet, as im thinking solely on how the UI would look like I am planning on doing it in wxpython though once Ive finished a prototype look. – user1932405 May 14 '14 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.