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

4001 questions
445
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,326
  • 7
  • 29
  • 38
208
votes
11 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
  • 77,313
  • 56
  • 165
  • 258
173
votes
11 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…
TeabaggingSanta
  • 1,834
  • 2
  • 7
  • 10
147
votes
14 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
  • 10,335
  • 15
  • 40
  • 70
112
votes
25 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
  • 9,976
  • 5
  • 37
  • 55
109
votes
12 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
  • 2,797
  • 2
  • 18
  • 26
97
votes
14 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
  • 35,261
  • 53
  • 143
  • 239
91
votes
8 answers

How to shift focus to 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
  • 6,203
  • 3
  • 34
  • 52
91
votes
13 answers

How to change TextField's height and width?

How to customise TextField's width and height?
Aravinth thiyagarajan
  • 1,113
  • 2
  • 8
  • 9
89
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
  • 939
  • 1
  • 6
  • 10
83
votes
2 answers

Rails not editable text field

I have a form_for written in the following manner:
<%= location.label :city %> <%= location.text_field :city, :disabled=>true%>
<%= location.label :country %> <%= location.text_field…
Joe
  • 1,689
  • 3
  • 16
  • 24
62
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,021
  • 4
  • 24
  • 30
61
votes
5 answers

Customizing Increment Arrows on Input of Type Number Using CSS

I have an input of type number that is rendered using the following code: It looks like this: I would like to turn it into something like…
MadPhysicist
  • 4,190
  • 7
  • 27
  • 80
60
votes
2 answers

Flutter: Outline input border

I was trying to build a border for my text field like: return TextField( ... border: OutlineInputBorder( borderSide: BorderSide( color: Colors.red, width: 5.0), ) ) ) But it always return a black border with 1.0 as width. The…
Little Monkey
  • 2,887
  • 6
  • 25
  • 57
56
votes
11 answers

Hide textfield blinking cursor

I have a textfield is there a way to hide the blinking text cursor? I say this because I am doing a horror/mystery website and one of the clues is to start typing anywhere. Maybe I can do it with javascript?
test
  • 15,464
  • 61
  • 155
  • 235
1
2 3
99 100