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
24
votes
2 answers
How to read a line in BufferedInputStream?
I am writing a code to read Input from user by using BufferedInputStream, But as BufferedInputStream reads the bytes my program only read first byte and prints it.
Is there any way I can read/store/print the whole input ( which will Integer )…

PankajKushwaha
- 878
- 2
- 11
- 25
24
votes
4 answers
How to get user confirmation in fish shell?
I'm trying to gather user input in a fish shellscript, particularly of the following oft-seen form:
This command will delete some files. Proceed (y/N)?
After some searching around, I am still not sure how to do this cleanly.
Is these a special way…

user456584
- 86,427
- 15
- 75
- 107
23
votes
1 answer
How does jsFiddle allow and execute user-defined JavaScript without being dangerous?
I've been working on a JS library and would like to setup a demo page on Github that allows, for example, users to define their own callbacks and execute commands.
I know "eval() is evil" and I can see how blind eval() of scripts could lead to XSS…

buley
- 28,032
- 17
- 85
- 106
23
votes
6 answers
Drag the Range of a UI Input Range Slider
<---------[]=====================================[]-------->
0 10 90 100
I need an input range slider with two handles to select a range, and the ability to drag the range (the equals signs in the…

Rudiger
- 231
- 1
- 2
- 4
23
votes
6 answers
Use Javascript to change which submit is activated on enter key press
I have a form on an HTML page with multiple submit buttons that perform different actions. However, when the user is typing a value into a text input and hit enters, the browsers generally act as though the next submit button sequentially was…

postfuturist
- 22,211
- 11
- 65
- 85
23
votes
8 answers
How to save user input into a variable in HTML and JavaScript
I am making a game and at the start it asks for your name, I want this name to be saved as variable. Here is my HTML code:
22
votes
4 answers
Suggest answer to user input in bash scripting
Here is an example:
#!/bin/bash
echo -e "Enter IP address: \c"
read
echo $REPLY
But I want to make it easier for the user to answer. I'd like to offer an answer to the user. It should look something like this:
Enter your IP: 192.168.0.4
And the…

Larry Foobar
- 11,092
- 15
- 56
- 89
21
votes
8 answers
Check Whether a TextBox is empty or not
I have a TextBox. And I want to check if it's empty.
Which way is better
if(TextBox.Text.Length == 0)
or
if(TextBox.Text == '')
?
user5683768
21
votes
6 answers
What does `scanf("%*[^\n]%*c")` mean?
I want to make a loop in C that, when the program asks for an integer and the user types a non-digit character, the program asks again for an integer.
I just found the below code. but I don't understand what this means scanf("%*[^\n]%*c"). What does…

Gustavo Alejandro Castellanos
- 336
- 1
- 3
- 7
21
votes
4 answers
Creating a popup message box with an Entry field
I want to create a popup message box which prompts user to enter an input. I have this method inside a class. I am basing my code on this guide by java2s.
class MyDialog:
def __init__(self, parent):
top = self.top = Toplevel(parent)
…

Bharat
- 2,960
- 2
- 38
- 57
20
votes
3 answers
How do you check if a string is not equal to an object or other string value in java?
I have been trying to make a clock that the user can set. I wanted the user to be asked questions and they answer in words like yes or no. I have done it for things that don't change using this code such as whether or not the user wants seconds to…

Pillager225
- 439
- 1
- 3
- 15
20
votes
5 answers
jQuery - remove user input text from textarea
Okay I have a list of devices where i can select which to edit.
I have 3 states for the edit. When no devices are selected, when 1 device is selected or when x devices are selected.
The problem i have is when a user type some text in the textarea…

Thor A. Pedersen
- 1,122
- 4
- 18
- 32
19
votes
6 answers
How to let the user select an input from a finite list?
Is it possible to ask for selection between multiple choices in Python, without an if loop?
Example:
print "Do you want to enter the door"
raw_input ("Yes or not")
And the user can only choose between the selections.

Gianni Alessandro
- 860
- 6
- 11
- 28
18
votes
5 answers
Limiting Python input strings to certain characters and lengths
I just started learning my first real programming language, Python. I'd like to know how to constrain user input in a raw_input to certain characters and to a certain length. For example, I'd like to show an error message if the user inputs a string…

kidosu
- 383
- 2
- 4
- 9
18
votes
2 answers
Register input from invisible form
I asked some usability experts about a rotating cube form I made. They correctly pointed out that when the face of the cube with the text boxes is not visible, they do not register any input.
That means that when the cube spins around and the user…

Peter Olson
- 139,199
- 49
- 202
- 242