Questions tagged [textfield]

A text field (or text box) is a user-interface control allowing the user to input text into a program.

A typical text field is a rectangle, often with a border. It can be either single-line or multi-line. In addition to typing, text fields allow for a variety of other activities, such as text selection (cut, copy, paste).

This GIF ("File:Textbox2.gif" on Wikimedia Commons) depicts a text field with text being entered:

A text field with the word 'Wikipedia' being typed in

4965 questions
451
votes
16 answers

jQuery Set Cursor Position in Text Area

How do you set the cursor position in a text field using jQuery? I've got a text field with content, and I want the users cursor to be positioned at a certain offset when they focus on the field. The code should look kind of like…
jcnnghm
  • 7,426
  • 7
  • 32
  • 38
409
votes
27 answers

How to create number input field in Flutter?

I'm unable to find a way to create an input field in Flutter that would open up a numeric keyboard and should take numeric input only. Is this possible with Flutter material widgets? Some GitHub discussions seem to indicate this is a supported…
Janne Annala
  • 25,928
  • 8
  • 31
  • 41
362
votes
19 answers

How do I supply an initial value to a text field?

I'd like to supply an initial value to a text field and redraw it with an empty value to clear the text. What's the best approach to do that with Flutter's APIs?
Seth Ladd
  • 112,095
  • 66
  • 196
  • 279
311
votes
13 answers

Flutter: how to make a TextField with HintText but no Underline?

This is what I'm trying to make: In the Flutter docs for Text Fields (https://flutter.io/text-input/) it says you can remove the underline by passing null to the decoration. However, that also gets rid of the hint text. I do not want any underline…
juan park
  • 3,224
  • 2
  • 10
  • 13
274
votes
22 answers

When the keyboard appears, the Flutter widgets resize. How to prevent this?

I have a Column of Expanded widgets like this: return new Container( child: new Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ new Expanded( flex: 1, child:…
Mary
  • 18,347
  • 23
  • 59
  • 76
191
votes
16 answers

How do I create a multiline TextField in SwiftUI?

I've been trying to create a multiline TextField in SwiftUI, but I can't figure out how. This is the code I currently have: struct EditorTextView : View { @Binding var text: String var body: some View { TextField($text) …
gabriellanata
  • 3,946
  • 2
  • 21
  • 27
183
votes
35 answers

How to hide keyboard when using SwiftUI?

How to hide keyboard using SwiftUI for below cases? Case 1 I have TextField and I need to hide the keyboard when the user clicks the return button. Case 2 I have TextField and I need to hide the keyboard when the user taps outside. How I can do this…
Hitesh Surani
  • 12,733
  • 6
  • 54
  • 65
182
votes
23 answers

How to change TextField's height and width?

How to customise TextField's width and height?
Aravinth thiyagarajan
  • 2,193
  • 3
  • 12
  • 10
171
votes
22 answers

SwiftUI: How to make TextField become first responder?

Here's my SwiftUI code: struct ContentView : View { @State var showingTextField = false @State var text = "" var body: some View { return VStack { if showingTextField { TextField($text) …
Epaga
  • 38,231
  • 58
  • 157
  • 245
158
votes
11 answers

How to shift focus to the next TextField in Flutter?

I am new to Flutter. I am building a form with multiple text inputs using following widgets: Form, TextFormField. The keyboard that appears doesn't show "next" (which should shift the focus to next field) field action instead it is "done" action…
Harsh Bhikadia
  • 10,095
  • 9
  • 49
  • 70
122
votes
17 answers

Disable a text edit field in flutter

I need to disable TextFormField occasionally. I couldn't find a flag in the widget, or the controller to simply make it read-only or disable. What is the best way to do it?
Arash
  • 11,697
  • 14
  • 54
  • 81
112
votes
13 answers

How to debounce Textfield onChange in Dart?

I'm trying to develop a TextField that update the data on a Firestore database when they change. It seems to work but I need to prevent the onChange event to fire multiple times. In JS I would use lodash _debounce() but in Dart I don't know how to…
DxW
  • 1,414
  • 3
  • 11
  • 23
105
votes
24 answers

What is the recommended way to make a numeric TextField in JavaFX?

I need to restrict input into a TextField to integers. Any advice?
Harry Mitchell
  • 1,100
  • 2
  • 7
  • 12
105
votes
6 answers

Flutter - How to change TextField hint color?

I'm a bit confused how to change the hint color of the textfield. Someone can guide me how to do it.Thanks child: TextField( style: TextStyle(fontSize: 20), decoration: InputDecoration( hintText: "Password", …
kelvincer
  • 5,929
  • 6
  • 27
  • 32
100
votes
4 answers

Flutter textfield background color on focus

I have a rounded textfield. It works well, but when the user taps on it, a grey color background appears. How can I disable that splash effect? This is my code and result: new Container( margin: const EdgeInsets.only(left: 30.0,…
Hesam Rasoulian
  • 1,356
  • 3
  • 12
  • 18
1
2 3
99 100