FAQ Database Discussion Community


Assign the value from a text field into an int variable to do some math with other variables and then return it?

ios,xcode,variables,textfield,assign
The code showing here assigns the value of an variables to the text field I want to do the opposite of that. _Initial.text = [NSString stringWithFormat:@"%f", init]; The opposite of the code above. Please help...

Validation of text fields and contact no text field

java,swing,validation,textfield
I have a JFrame consisting of some text fields (10) and a TextArea. I want to validate all the text fields and see if they are not empty and also check if a 10 digit contact no is entered in one of the text field. After checking the text fields,...

User Cannot Enter Text, Index Out Of Bounds Exception

java,arraylist,javafx,textfield,indexoutofboundsexception
My code runs but when the user inputs text into the text field I am getting an Out Of Bounds Exception. I think it has something to do with this line of code where I give the empty box a value: int express = (str != null && !"".equals(str)) ?...

Cannot see the whole information from my database in a text field if i have a space in my text

php,mysql,forms,textfield,space
I have problem in my site, to be more specific in my edit pages and especially in my edit textfields it does not shows the whole information in the textfields. As you can see in the images, in the text fields it does not shows the whole information. I want...

JFrame/JPanel refreshing and text fields

java,jframe,jpanel,refresh,textfield
I'm trying to switch between displaying different JPanels in BorderLayout.CENTER in a JFrame. The JPanels each contain a JTextField and a JTextPane. Calling revalidate() and repaint() on the JFrame, I get a very strange result: the first time I switch to secondPanel by clicking secondButton, everything works as expected. Then...

Dynamic Adding of Text Fields JQuery

jquery,html,textfield
Hi I'm new to JQuery and I'm making a API Tool just like https://www.hurl.it/ I also want to have the Add Parameters Button and it will create a parameter name and a value field and render it inside a div. Here's my form. <div class="panel-body"> {!! Form::open(array('url' => 'invoker', 'class'...

set value textfield from another viewcontroller

ios,swift,textfield
i edited my question , because set textfield maybe can't be simple, need references so this is my code, but still have issue : this code for TableViewController : import UIKit protocol PaymentSelectionDelegate{ func userDidSelectPayment(title: NSString?) } class PopPaymentTableViewController: UITableViewController { var delegate : PaymentSelectionDelegate! override func viewDidLoad() { super.viewDidLoad()...

How to display TextField at the bottom of the screen

qml,textfield,qtquick2,sailfish-os
I want to display a TextField at the bottom of the screen in QML for SailfishOS. I attempted multiple tries but the TextField is always at the top of the screen. import QtQuick 2.0 import Sailfish.Silica 1.0 ApplicationWindow { id: screen anchors.fill: parent Item { width: parent.width; anchors.bottom: screen.bottom TextField...

focusing a text field in swift

ios,swift,textfield
I have 4 textfields on a register screen and i have it set up so that when the user presses next on each text field, the next text field is focused. Code below: func textFieldShouldReturn(textField: UITextField) -> Bool { if (textField == self.fNameField) { textField.resignFirstResponder() self.sNameField.becomeFirstResponder() } else if (textField...

replace text in textField with object name - Pymel

python-2.7,textfield,maya,pymel
I've realized that there were similar questions located here: textfield query and prefix replacing and here: Python - Change the textField after browsing - MAYA However, these do not address the issue if you have two definitions and need the text in the textField to be queried (actually CHANGE the...

Add TextField on Chart

java,swing,text,javafx,textfield
I'm using JavaFX in Swing so I have method: private Scene createScene() { Group root = new Group(); Scene scene = new Scene(root); BorderPane borderPane = new BorderPane(); ... //adding data series to Linechart baseChart ... StackChart chart = new StackChart(baseChart); //returns StackPane with LineChart-s on it borderPane.setCenter(chart); root.getChildren().add(borderPane); return...

JavaFX TextField causes NullPointerException

nullpointerexception,javafx,textfield
I am using a Button with an event to control the input of a user, but I am having trouble checking whether or not the TextField is empty. The TextField and Button are declared before the button event, like TextField svar = new TextField(); Button submitB = new Button("submit"); This...

Sencha ExtJS: How do I prevent the cursor from leaving the current position in a phone number field upon edit?

extjs,sencha-touch,textfield,phone
Cursor automatically moves to the end of the phone number after 1 backspace move, it should remain in parentheses because the user could just want to edit the area code. (CODE AND IMAGES INCLUDED...scratch that, don't have 10 rep to post pictures, :/) Here is the code for the text...

pre-populate wtforms text field with values

python,flask,textfield,wtforms
I can't figure out how to pre-populate a TextField with WTForms. I have a field called organization that i defined: organization = TextField('Organization name:') # I defined also a function def __init__(self, *args, **kwargs): nameoforganization = session.get('name') How can i populate TextField organization from nameoforganization. Can anybody help me!. Thanks...

extract string from a json object

json,extjs,textfield,jsonobject
I have an attribute in the extjs code defined as : datajson: { 'name' : 'Hello', .... } Now I need to set the value of a textfield to the name defined inside this attribute. I have tried the following but its not working: Ext.getCmp('name').setValue((this.datajson.xyz.name).toString()); The id of the textfield...

Function not running when return pressed

ios,swift,keyboard,textfield
I have a textfield, when something is typed in the textfield and "return" on the keyboard is pressed, the keyboard should hide. But it doesn't.. Here is the code I am using: import UIKit class EditTableViewController: UITableViewController, UITextFieldDelegate { var product: Product? @IBOutlet weak var productImageView: UIImageView! @IBOutlet weak var...

Section Names In Table Views

swift,tableview,textfield,sections
How can I take a text of textfield, and make it as name of a section in a tableview? I want to do this in Swift and Xcode 6. Thank you very much.

Is it possible to set different colors for different lines in a javafx textField/Area?

java,colors,javafx,textarea,textfield
I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable?

How Vaadin translates &Address to Alt+A using shortcut by a shorthand notation in AbstractField.FocusShortcut?

java,keyboard-shortcuts,vaadin,textfield,shorthand
reading this page of the Book of Vaadin: https://vaadin.com/book/vaadin7/-/page/advanced.shortcuts.html You can also specify the shortcut by a shorthand notation, where the shortcut key is indicated with an ampersand (&). // A field with Alt+A bound to it, using shorthand notation TextField address = new TextField("Address (Alt+A)"); address.addShortcutListener( new AbstractField.FocusShortcut(address, "&Address"));...

ios/xcode/objective c: Capture last keystroke in textfield

ios,textfield,ontouchevent
I have a method to enable the save button that I want to fire when the user meets several conditions, for example, username is at least 4 characters. To test these conditions I need to check with every keystroke. What is best touch event (through storyboard) to capture this? Have...

ComboBox with TextField

java,combobox,javafx-8,textfield
I would like to offer my user the choice between one of the predefined enums or an inputted int when using a ComboBox. I can't figure out why the text in the TextField keeps dissapearing. IndexOutBoundsException out of nowhere when using the ComboBox After selecting the TextField for the first...

Resize textField Based On Content

ios,swift,resize,textfield
How can a textField be resized based on content while using auto-layout in an iOS application written in Swift? The text field will resize as necessary to fit its content when the view loads as well as while the user is typing. Ideally, the text field would stop resizing at...

Can't type in text fields everywhere

twitter-bootstrap,locking,textfield
I was working on a client site but found a problem that text fields are locked or can't type in it, just looking good means blinking normally if you click on text fields (but can't type). A simple query but not looks like a simple one to me!...

Swift: Problems with getting text from UIAlertView textfield

ios,swift,alert,uialertview,textfield
I'm using Swift with Xcode 6.3. In my application I want a alert with a textfield. After clicking on "Done" I want to save the textfield input in a String. After clicking on "Cancel" I want only to close the alert. I've created my alert like this: var alert =...

how to have default value for a text field only for new form in rails? iam using :value => “0”.but in edit form also iam getting '0' value

ruby-on-rails,forms,default,textfield,value
How to have default value for a text field only for new form in rails? I am using :value => "0" in form partial. But the problem is though I have a value in database, I am getting 0 in edit form. actually in new form for a text field...

a web application having three textbox under one Label “Full Name”.

sql,label,textfield
textbox "First Name","Middle Name","Last Name" under Label "Full Name" i want to specify Label and textbox......how to query? I am using SQL Server Management Studio. if I do this: create table FullName(FName,MName,LName) values (' ',' ',' ') is this right?...

Java JTextfield gives me only null data

java,swing,frame,textfield
I made a Mainmenu JFrame which can generate 4 different new frame represents each menu. Mainmenu frame was works fine. but I found that it could't get text from new frame textfield. here is error report and source code. please let me know how to fix it. import java.awt.BorderLayout; import...

Different borders on each side of a TextField

css,javafx,textfield,scenebuilder
How can I change a textfields borders color in a way that two vertical borders have a same color and two horizontal borders have a same color using CSS? Is there any way to make four border lines have four different color? Thanks...

How to get values in this json object in ext js?

json,extjs,textfield
I try to get values and put in a textfield. return json is ; Object { info=[1]} in this info[Object { name="name", another ="another"}] clearly ; {"info":[{"name":"name","another":"another"}]} i do ; var resp = Ext.decode(response.responseText); txtName.setValue(resp.info); and in text field it shown [Object object] How to i get name and another...

ios/xcode/coredata: How to mimic ajax call in objective c

ios,core-data,tags,textfield
For a tag system, when entering a new item, I'd like the user to start typing a letter or two and see possible tags...similar to how SO tags work on the website i.e. Ajax. Is there a way to do this on IOS? Basically the Add Item screen has some...

TextField formatting (padding) issue in Titanium Android

android,formatting,textfield,titanium-mobile,titanium-android
I am facing the issue of formatting a simple textfield in Titanium Android. Problem : I am not able to view the text field input value that I enter. If I print the logs its getting entered but not visible. In some devices I get cut-off text. Below is my...

Text starts from right side of the textfield in extjs

extjs,textfield
I wish that when a person starts typing in the textfield the text is populated from the right side. Think of it as right-justified. Is there a way to do this ?

Swift - Get keyboard input as the user is typing

ios,swift,keyboard,textfield,keyboard-input
I have an app in swift, where the texfield is located at the bottom of the screen, and when the user tries to type anything, the keyboard covers the textfield, so the user is unable to see what he/she is typing. To solve this, I would like to get the...

Django: show newlines from admin site?

python,html,django,newline,textfield
This is probably very simple. My database objects have a TextField. Now, when I add the contents of the TextFields to an html paragraph, there are no new lines. How can I make Django show those newlines? Thank you!

Comma Automatically Being Added to TextField in Swift

swift,numbers,textfield,comma
I'm working on a status bar application. Currently all I have is a drop down menu that either quits the app or opens a preferences window. There is a textfield in the window that will be for a number value. While testing I noticed that when I used .orderOut to...