User Input is data that the user inputs into the program. It generally takes the form of a String, but may also be an integer, floating-point number, etc.
Questions tagged [user-input]
5580 questions
7
votes
4 answers
Javascript to clear form field on button click
I have a field called 'inputaddress' which a user types address details into, so they can perform a google map geocode.
What I would like to do is when the user clicks on the 'searchfortheaddress' button, it will perform the geocode but will then…

IRHM
- 1,326
- 11
- 77
- 130
7
votes
4 answers
keep user-generated content from breaking layout?
I have a site that wraps some user-generated content, and I want to be able to separate the markup for the layout, and the markup from the user-generated content, so the u-g content can't break the site layout.
The user-generated content is trusted,…
user35288
7
votes
4 answers
Python command Line - multiple Line Input
I'm trying to solve a Krypto Problem on https://www.spoj.pl in Python, which involves console input.
My Problem is, that the Input String has multiple Lines but is needed as one single String in the Programm.
If I just use raw_input() and paste (for…

Dreiven
- 687
- 3
- 9
- 22
7
votes
2 answers
What are the difference in usage between Either and Except in Haskell?
I have a class that can be created from several arguments in Haskell which requires some complex validation of those arguments. Currently I have something like
makeAThingExcept :: String -> String -> ... String -> Except ThingError…

orome
- 45,163
- 57
- 202
- 418
7
votes
2 answers
Linux/X11 input library without creating a window
Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a…

rck
- 2,020
- 2
- 23
- 23
7
votes
2 answers
google apps script: html - form submit, get input values
I'm trying to use a sidebar with a form to get user input. The code is bound to a Google Sheets file.
Code.gs:
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Show sidebar', 'showSidebar')
…

Sara
- 85
- 1
- 1
- 6
7
votes
3 answers
Accepting more simultaneous keyboard inputs
Sometimes, a normal computer keyboard will only accept user's inputs up to a certain key simultaneously. I got a logitech keyboard that can accept up to 3-4 key presses at the same time. The computer does not accept any more input if you press more…

Karl
- 5,613
- 13
- 73
- 107
7
votes
2 answers
Read a Ruby string one character at a time (for word wrapping)
I know this question is a fundamental one. I am able to take user input for a string and for an integer using:
str = gets()
num = gets().to_i
But I want to read from the String(say which is in my case more than a line in length) character by…

boddhisattva
- 6,908
- 11
- 48
- 72
7
votes
2 answers
How can I get make my program wait until JavaFX window has been closed before continuing?
I have a program that is displaying a barchart of results. I want to wait until the user closes the bar chart to continue to the next line of code which is asking if they want to enter new information for the chart.
Scene scene =…

Crislips
- 420
- 1
- 4
- 13
7
votes
1 answer
Sorting algorithm for inconsistent (non-transitive) human preferences
Suppose I have a file with a one-liner (joke) on each line. I want to sort the jokes by how funny I find them. My first thought is to implement any sorting algorithm (preferably one that makes as few comparisons as possible) and having the…

nebuch
- 6,475
- 4
- 20
- 39
7
votes
1 answer
How to 'read -s' in shell?
I know that user input can be read silently using bash with read -s someVar and I was wondering if there is a /bin/sh equivalent that allows user input without displaying it on the command line?
Note: I am just curious if /bin/sh read supports this…

Alex Cohen
- 5,596
- 16
- 54
- 104
7
votes
3 answers
Tweaking on keyup event to call API once it appears user has finished typing
I have a postcode field that has a jQuery onKeyup event - the idea is that once they have fully entered their postcode to call an Google Maps Geocoding API to get the location immediately based on this postcode.
This code works however i'd like to…

Zabs
- 13,852
- 45
- 173
- 297
7
votes
2 answers
Press any key to abort in 5 seconds
Hi I'm trying to implement an event that will happen after a 5 second countdown, unless a key is pressed. I have been using this code, but it fails if I press enter or space. It fails in the sense that enter or space is detected as "".
echo…

inkman
- 71
- 3
7
votes
2 answers
Python while loop with user input
I have this simple little program which doesn't work. I want the program to keep asking the user for my name till they guess it.
The program throws an error message after the first attempt. I can't work it out where the problem is.
name =…

leela.fry
- 283
- 2
- 3
- 13
7
votes
2 answers
Javascript search and display divs with matching keywords
What I'm looking for:
I'm working on creating an easy way for a user to search a list of people, and for results to instantly display below the search field. The results MUST display "close" results, rather than exact. For example: User searches for…

Steve
- 111
- 2
- 6