textfield

How to get user input from UItextfield and add it to an array?

僤鯓⒐⒋嵵緔 提交于 2021-01-29 15:51:45
问题 I am working in swift. I have a textfield that is in a tableview cell. I am trying to store the text of each text field in the tableview so they when the user adds or deletes a row, and then the tableview reloads data, that the text fields stay filled in with the appropriate data. I tried adding a textfielddidendeditting function but for some reason it is not being called. EDIT: Here is my code: tableViewController: import UIKit var rowCount = 0 var textArray = [String]() class

How to replace plus (+) signs with spaces ( ) in GET parameters with javascript

心不动则不痛 提交于 2021-01-29 12:56:54
问题 I get users redirected to my site with GET parameters like this: www.example.com/?email=mail@mail.com&vorname=name1+name2 I use javascript to populate my texfields (newsletter subscription) like this: function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } function getUrlParam(parameter, defaultvalue){ var urlparameter = defaultvalue; if(window.location.href.indexOf(parameter) > -1

error: The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'

爷,独闯天下 提交于 2021-01-29 11:24:12
问题 I have some fields which post String and int , the String fields are working properly and I am getting these values at the db, the at the int type fields I'm getting this error message. The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'. I'm using bloc to post to a firebase db. here is how it looks. Widget build(BuildContext context) { final trackerBloc = Provider.of<TrackerBloc>(context); String docId = DateTime.now().millisecondsSinceEpoch.toString

Flutter textfield on fireOS firetv/firestick on top of textfield

左心房为你撑大大i 提交于 2021-01-29 07:07:32
问题 When calling textfield on flutter in fireOS in the fire tv devices, to do a search for example the fireOS virtual keyboard pops on top of textfield and doesnt work like on other android devices where the keyboard is on the bottom and textfield is visible. On android legacy for example i can use edittext widget and the same keyboard pops on top but whatever i type with the controller updates on the virtual keyboard itself, because the keyboard has its own textfield or edittext. So my problem

How to add a TextField to Alert in SwiftUI?

血红的双手。 提交于 2021-01-20 16:23:59
问题 Anyone an idea how to create an Alert in SwiftUI that contains a TextField? 回答1: As the Alert view provided by SwiftUI doesn't do the job you will need indeed to use UIAlertController from UIKit . Ideally we want a TextFieldAlert view that we can presented in the same way we would present the Alert provided by SwiftUI : struct MyView: View { @Binding var alertIsPresented: Bool @Binding var text: String? // this is updated as the user types in the text field var body: some View { Text("My Demo

using SingleChildScrollView whit Flexible Widget

陌路散爱 提交于 2021-01-05 07:36:05
问题 i ran in to Problem while trying Textfield Widget :"bottom overflowed by 48pixels".after that i tried to use SingleChildScrollView widget,but it became more complicated,it shows now this error: ======== Exception caught by rendering library ===================================================== RenderBox was not laid out: RenderCustomPaint#7fee2 relayoutBoundary=up3 NEEDS-PAINT any Suggestion how can i solve this Problem?! emulator without use of SingleCHildScrollView import 'package:flutter

SwiftUI textfield color

拜拜、爱过 提交于 2020-12-13 19:01:27
问题 any idea how to change the color of the textfield placeholder like the attached picture? I can't find the way to color the text "email" in white, it always stay in grey. i want to make it same like the picture. thanks a lot for the help SecureField(String("Password"), text: $pass).padding(.all).border(Color.white).cornerRadius(3.0).padding(.horizontal) 回答1: Find below a demo of some possible approach. Also might worth considering representable around UITextField as it is much more

How to add hint text in a Textfield in JavaFX

本小妞迷上赌 提交于 2020-12-08 06:15:49
问题 I want to add some hint text in a textfield, like "name" or "surname". I create the textfield like this TextField userTextField = new TextField(); , but I cannot find how to do that. Here, I just found this Clear prompt text in JavaFX TextField only when user starts typing but I cannot believe this is the only way to do it. Or I am wrong? 回答1: I do it like this: userTextField.setPromptText("name"); //to set the hint text userTextField.getParent().requestFocus(); //to not setting the focus on

How to add hint text in a Textfield in JavaFX

∥☆過路亽.° 提交于 2020-12-08 06:13:20
问题 I want to add some hint text in a textfield, like "name" or "surname". I create the textfield like this TextField userTextField = new TextField(); , but I cannot find how to do that. Here, I just found this Clear prompt text in JavaFX TextField only when user starts typing but I cannot believe this is the only way to do it. Or I am wrong? 回答1: I do it like this: userTextField.setPromptText("name"); //to set the hint text userTextField.getParent().requestFocus(); //to not setting the focus on

Flutter Enable/Disable Button based on TextFormField content

一个人想着一个人 提交于 2020-12-03 11:26:51
问题 How can I activate/deactivate a button based on the content of a TextFormField? I want to make sure a user can only press Button X if the TextFormField has 10 entered numbers (if it's a mobile number). Thanks! 回答1: A simple way would be to set the autovalidate property of our TextFormField to true . This will automatically detect for changes on our TextFormField widget. We can then try to check if our TextFormField's value has a String length of 10 characters on the validator property . After