Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-10-2010, 11:54 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
Makubesu is on a distinguished road
Question Getting next button to work in a text field

I'm having my user fill out a form in my app. For example:
Name _____
Email _____

I would like to let the user switch between fields using a next button in the bottom right hand corner of the keyboard. In interface builder, if you select the return key drop down menu, you can change the "return" on the keyboard to "next".

However, when I fire up my app and push the next button, nothing happens. How do I tell my program that these text fields are linked together?
Makubesu is offline   Reply With Quote
Old 09-10-2010, 12:04 PM   #2 (permalink)
Elegance is Infinite
iPhone Dev SDK Supporter
 
TapTouchClick's Avatar
 
Join Date: Jan 2010
Location: Bay Area, CA
Posts: 677
TapTouchClick is on a distinguished road
Send a message via AIM to TapTouchClick Send a message via Skype™ to TapTouchClick
Default

Put the textFields in an array or tag them. Then use becomeFirstResponder within the textFieldDidReturn (when next is clicked) for the next tag or item in the array. Apple doesn't do this for you.

HTH
Quote:
Originally Posted by Makubesu View Post
I'm having my user fill out a form in my app. For example:
Name _____
Email _____

I would like to let the user switch between fields using a next button in the bottom right hand corner of the keyboard. In interface builder, if you select the return key drop down menu, you can change the "return" on the keyboard to "next".

However, when I fire up my app and push the next button, nothing happens. How do I tell my program that these text fields are linked together?
__________________
Our website
TapTouchClick is offline   Reply With Quote
Old 09-10-2010, 12:21 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
Makubesu is on a distinguished road
Default

Thanks for your help!
Makubesu is offline   Reply With Quote
Old 09-10-2010, 07:27 PM   #4 (permalink)
David Porter Apps
 
bobbypage's Avatar
 
Join Date: Aug 2009
Posts: 71
bobbypage is on a distinguished road
Default

Hey it's very easy to do... just hook up a IBAction to the first textfield (use DidEndOnExit).

Then do something like this
Code:
- (IBAction)nextPressedOnKeyboard {
// this gets called when the user presses next (on the first textfield) on the keyboard

[textField2 becomeFirstResponder]; //change the current editing textField to textField2

}
__________________
Check out my website/blog: http://www.davidporterapps.com

Follow Me on Twitter:
http://twitter.com/bobbypage
bobbypage is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 325
9 members and 316 guests
bignoggins, carlandrews, flamingliquid, hzwegjxg, ilmman, jenniead38, linkmx, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:52 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0