• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: submit textfield without pressing ener
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: submit textfield without pressing ener


  • Subject: Re: submit textfield without pressing ener
  • From: Tim Isted <email@hidden>
  • Date: Fri, 5 Sep 2008 19:44:15 +0100

Depending on how you're implementing your login dialog, if you have a method that is called when the ok button is clicked and you have IBOutlets for the text field or the login dialog itself, in that method you can either:

 a) call [theTextField commitEditing]; on the text field or

 b) call [loginWindow makeFirstResponder:nil];

The second way will take first responder status away from any currently uncommitted text field editor (ie the current first responder) and force it to commit its editing without you having explicity to call commitEditing on that text field (and any other text fields that might currently have un-committed data like a username field etc).

Hope that helps,
Tim


On 5 Sep 2008, at 19:12, Ronnie B wrote:

Hi All.

I have a login dialog with a text field for password and OK and Cancel
buttons. But, unless I hit Enter key, the text field value does not get
submitted. What can I do to have it working only with the OK buttons,


Thanks,
R.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: submit textfield without pressing ener
      • From: "Ronnie B" <email@hidden>
References: 
 >submit textfield without pressing ener (From: "Ronnie B" <email@hidden>)

  • Prev by Date: Re: understanding conversions between CF and NS datatypes
  • Next by Date: Re: submit textfield without pressing ener
  • Previous by thread: submit textfield without pressing ener
  • Next by thread: Re: submit textfield without pressing ener
  • Index(es):
    • Date
    • Thread