• 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: what to do with the <return> key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what to do with the <return> key


  • Subject: Re: what to do with the <return> key
  • From: Ian Joyner <email@hidden>
  • Date: Mon, 5 Mar 2007 11:43:16 +1100

This is what I do. You need to attach a little bit of JavaScript to all your text fields:

function check_enter (event) {
	// Stop user logging out when return or enter pressed.
	// We need a better way of attaching them to the + button.

	var code = document.layers? event.which: event.keyCode;

	if (code == 13 || code == 3) {
		document.Video_library.submit ();
		return false;
	}

	return true;
}

Add a binding to the text fields "onKeyPress" to call this function. (Press + in the top right corner of the text field inspector).

new_playlist_name: WOTextField {
	value = session.playlists.new_playlist_name;
	onKeyPress = "return check_enter (event)";
}

In check_enter above, I wanted the form to be submitted, but it stopped the submit going to the first button (which happened to be log out). So you want to transform the above into returning a tab to next field (I don't know if that will actually work), but at least you can get rid of responses to crs and enters.

Ian

On 04/03/2007, at 10:26 AM, Baiss Eric Magnusson wrote:

I watched, a bit aghast, as a Windows user was on my Mac and constantly hitting the <return> key in the middle of form entry.

Well, I don't handle that situation well at times, and, well what does one do to trap, or better yet, to disable the return key from doing a <submit> of the form.

I see that the Return key is going to the first <WOImageButton> on the Form, which at times would be ok, at others not. Should I allow the Return key to do a <submit>? And if so, how do I tell it in the <WOImageButton> action method to do the <changeEdit> method instead of the method that it would do if clicked on?
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40sportstec.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: what to do with the <return> key
      • From: Sam Barnum <email@hidden>
References: 
 >what to do with the <return> key (From: Baiss Eric Magnusson <email@hidden>)

  • Prev by Date: Re: newbie: basic question on getting a value from an entity
  • Next by Date: Re: Is there an easy way
  • Previous by thread: what to do with the <return> key
  • Next by thread: Re: what to do with the <return> key
  • Index(es):
    • Date
    • Thread