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
9
votes
2 answers

Disable Text Entry in

I am making a simple web app. At one part of it, I have included an input box of type="number" Anyhow, when I run the code in my latest Google Chrome Browser, I am able to enter text too: I do not want users to be…
coder
  • 1,809
  • 4
  • 19
  • 24
9
votes
4 answers

Safely executing user-submitted python code on the server

I am looking into starting a project which involves executing python code that the user enters via a HTML form. I know this can be potentially lethal (exec), but I have seen it done successfully in at least one instance. I sent an email off to the…
Josh Hunt
  • 14,225
  • 26
  • 79
  • 98
9
votes
5 answers

scrollHeight not resetting after programmatically changing content

I am trying to learn a few things without jQuery. Here is one of the challenges I'm facing. I have a fixed contenteditable div that when adding text to the div, if the scrollHeight exceeds the clientHeight I shrink the font until content fits the…
ohmusama
  • 4,159
  • 5
  • 24
  • 44
9
votes
1 answer

How to preform whitelist-based CSS filtering in PHP

I am working on a site and I would like to make a user able to enter custom CSS into that will be publicly displayed. However, seeing as a good deal of XSS attacks can be preformed through CSS, I would like to be able to find a way to "clean" the…
MiffTheFox
  • 21,302
  • 14
  • 69
  • 94
8
votes
3 answers

Schedule tasks using django-celery based on user input

I am building a reporting portal using django. In this portal I need to give users the ability to schedule reports to run on a reoccurring basis. I have been researching django-celery and understand that you can use the periodic_task decorator to…
user1042361
  • 590
  • 4
  • 11
8
votes
3 answers

"Read" command in bash script is being skipped

I'm creating a script to update my linux distribution if I need to wipe the HD or I need to install Linux on another machine. So this script basically install all the programs I usually need. At the beginning a have a "read" command that asks if I…
user872015
8
votes
1 answer

Jetpack Compose Number Input in to TextField

I am currently unable to capture user input in to a textfield when the KeyboardType of the keyboard is set to KeyboardType.Number. If the keyboard is set to KeyboardType.Text, the Textfield updates as expected, however when set to…
8
votes
1 answer

Correct way to escape input data before passing to ODBC

I am very used to using MySQL and mysql_real_escape_string(), but I have been given a new PHP project that uses ODBC. What is the correct way to escape user input in a SQL string? Is addslashes() sufficient? I would like to get this right now…
psx
  • 4,040
  • 6
  • 30
  • 59
8
votes
3 answers

Good practices for parsing user inputs with special characters?

Greetings, I am the program writer for the rebellion against the evil galactic empire. Right now, we are preparing for a daring assault on the Death Star. I have created a vast database of information about our pilots, droids, and systems aboard…
Vivian River
  • 31,198
  • 62
  • 198
  • 313
8
votes
2 answers

Validator that must accept only specific numeric values

I am using Hibernate Validator in addition to javax.validation library to validate request bodies of controllers in a Spring MVC application. There are annotations for constraints that help with min and max boundaries and also with the number of…
Limbo Exile
  • 1,321
  • 2
  • 21
  • 41
8
votes
1 answer

Recognize arrow keys in Java Scanner or Console application

I am writing a Java application that uses both Scanner and Console to get input from the user. I would like to add command history support so that the user can use the ARROW KEYS to search previous inputs (similar to a terminal). Is there a way to…
Miguel Velez
  • 586
  • 2
  • 8
  • 19
8
votes
4 answers

React-native store data between sessions

I need to store some user data, such as settings, login, token etc. between session. Tried asyncstorage but when I restart app, data in it gets deleted. Found some modules that refers to keychain or NSUserDefaults, but I don't know which and any of…
Michał Zubrzycki
  • 845
  • 3
  • 11
  • 20
8
votes
3 answers

Single character console input in java/clojure

How can I read a single character/key from the console without having to hit Enter? There is an old entry in Sun's bug database claiming that it can't be done in pure java. I've found these approaches JNI JLine…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
8
votes
6 answers

JOptionPane Input to int

I am trying to make a JOptionPane get an input and assign it to an int but I am getting some problems with the variable types. I am trying something like this: Int ans = (Integer) JOptionPane.showInputDialog(frame, "Text", …
kxk
  • 576
  • 2
  • 11
  • 30
8
votes
5 answers

Should the function or the caller be responsible for input validation?

I'm doing a security audit on a fairly large php application and was wondering where I should include my user-input validation. Should I validate the data, then send the clean data off to the back-end functions or should I rely on each function to…
haudenschilt
  • 160
  • 2
  • 10