Questions tagged [user-input]

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.

5580 questions
7
votes
2 answers

What are the basics of dealing with user input events in Android?

I thought I had understood this question, but something is quite wrong here. When the user (me, so far) tries to press keys, nothing really happens, and I am having a lot of trouble understanding what it is that I've missed. Consider this before I…
Panzercrisis
  • 4,590
  • 6
  • 46
  • 85
7
votes
7 answers

Do you break up addresses into street / city / state / zip?

My current app needs to store address information for a user. I'm currently debating whether to use the customary street address / city / state / zip textboxes and dropdowns or to go with Google's method of simply having everything on one line. …
Kevin Pang
  • 41,172
  • 38
  • 121
  • 173
7
votes
4 answers

Is it safe to display user input as input values without sanitization?

Say we have a form where the user types in various info. We validate the info, and find that something is wrong. A field is missing, invalid email, et cetera. When displaying the form to the user again I of course don't want him to have to type in…
Svish
  • 152,914
  • 173
  • 462
  • 620
7
votes
4 answers

PHP: best security practices for displayed information?

In PHP, I know that using parameterized queries is the best way to prevent SQL injection. But what about sanitizing user input that will be used for other purposes, such as: Displaying back to a user (potential cross-site scripting…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
7
votes
4 answers

Identifying the data type of an input

I am trying to print the data type of a user input and produce a table like following: ABCDEFGH = String 1.09 = float 0 = int true = bool etc. I'm using Python 3.2.3 and I know I could use type() to get the type of the data but in Python all user…
Apeiron Kambyses
  • 99
  • 1
  • 2
  • 7
7
votes
3 answers

Most Pythonic way to do input validation

What is the most "correct", Pythonic way to do user input validation in Python? I've been using the following: while True: stuff = input("Please enter foo: ") try: some_test(stuff) print("Thanks.") break except…
henrebotha
  • 1,244
  • 2
  • 14
  • 36
7
votes
2 answers

Using wxPython to get input from user

Suppose I need to replace the raw_input function in the following code with a wxPython dialog box that asks for user input and returns the value to program: ... x = raw_input("What's your name?") print 'Your name was', x ... I'm just looking for a…
AXO
  • 8,198
  • 6
  • 62
  • 63
7
votes
4 answers

Javascript - User input through HTML input tag to set a Javascript variable?

I want there to be a textbox on my screen(like the one i'm typing in now) that you can type in then click a submit button and it sends whatever you typed in the box to javascript and javascript prints it out.Here is my code This is the part that…
user1836262
  • 133
  • 2
  • 4
  • 11
7
votes
3 answers

Greyed-out "waiting" page in Javascript?

Possible Duplicate: Div as modal - javascript Is there a way to somehow lock a page in Javascript until a function call is complete? What I have in mind is like a semi-transparent grey cover that prevents any other user actions such as…
asteri
  • 11,402
  • 13
  • 60
  • 84
7
votes
2 answers

How can I escape forward slashes in a user input variable in bash?

I'm working on a script to make setting up a Statamic site more efficient. The problem I'm running into is that the variable I'm using to replace a string in a file has unescaped forward slashes and is user input. How can I make sure that _site_url:…
Curtis Blackwell
  • 3,130
  • 3
  • 27
  • 45
7
votes
3 answers

Preparing user-defined search term(s) for query

For a search feature I wrote a MySQL query to be executed by a PHP script. I'm not doing a fulltext search. Instead, I'm doing a search using the following method: ... WHERE field LIKE '%etc%' AND field REGEXP '[[:<:]]etc[[:>:]]' Now, my idea is to…
inhan
  • 7,394
  • 2
  • 24
  • 35
7
votes
7 answers

What percentage of my time will be spent in user input verfication during web development?

I'm new to developing things on the web. So far, I'm spending a lot of time (50% or so) to try and prevent bad people from putting things like sql injection into my input forms and validating it server side. Is this normal?
danmine
  • 11,325
  • 17
  • 55
  • 75
7
votes
2 answers

Allowing the user a sandboxed version of a programming language

Note: I'd appreciate some tag suggestions for this one.. I'd like to provide my users with a method of programmatically manipulating data on the server. This would be done by using an in-browser code editor to be executed at a later date, not…
Nick
  • 6,967
  • 2
  • 34
  • 56
7
votes
2 answers

Turn a User Input String to Upper Case Java

This may seem like a silly question, but after going through pages of google, i havnt been able to find the answer i want. s1.setName(JOptionPane.showInputDialog("Enter Name: "); For the above piece fo code, how would i format the data the user…
user1081326
  • 415
  • 5
  • 10
  • 19
6
votes
6 answers

Reading and checking strings from user input

I have this code: import java.util.Scanner; public class Example { public static void main(String[] args) { Scanner input = new Scanner(System.in); String answer = input.nextLine(); if(answer == "yes"){ …
Cole
  • 2,805
  • 9
  • 44
  • 61