• 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: Javascript focus on text field in repetition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Javascript focus on text field in repetition


  • Subject: Re: Javascript focus on text field in repetition
  • From: "John Huss" <email@hidden>
  • Date: Tue, 14 Feb 2006 13:42:45 -0600

Ok, I've got the text field numbering and access mostly working. I still have a problem.

My form is a master-detail form. I have a button to add a new detail item, which adds a new row to my table and repetition. I want to set focus on the textfield in the new row that get generated after the form is submitted and the page reloads.

I can't use the onclick event of the button because the focus disappears after the page reloads. How do I execute the javascript after everything has been re-generated?

John

----- Original Message ----- From: "zac" <email@hidden>
To: "WebObjects Dev Apple" <email@hidden>
Sent: Tuesday, February 14, 2006 12:31 PM
Subject: Re: Javascript focus on text field in repetition



John,

What are you basing the repetition on? If it's a display group, you should be able to use the built in functionality to get the focus. If not I'd look at constructing the whole thing in a function that returns an array. This way you can still dynamically generate the content but you can add the additional logic to set the index.

Let us know what you go with and how well it works.

Zac

John Huss wrote:

I'm trying to set focus on a text field that is inside a repetition in a table. I'd like to set focus on the first field in the last row of the repetition.
First I tried naming the field so I could focus on it. But naming the field (name="myfield") makes the repetition not work -- it repeats the first value in every row.
Then I considered accessing the element with an index, but since the repetition is dynamically generated, its hard to know what index to use.
Any ideas?
Thanks,
John
------------------------------------------------------------------------


_______________________________________________
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


_______________________________________________ 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


_______________________________________________ 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: Javascript focus on text field in repetition
      • From: Art Isbell <email@hidden>
References: 
 >Javascript focus on text field in repetition (From: "John Huss" <email@hidden>)
 >Re: Javascript focus on text field in repetition (From: zac <email@hidden>)

  • Prev by Date: Re: Obtaining a request
  • Next by Date: Re: Javascript focus on text field in repetition
  • Previous by thread: Re: Javascript focus on text field in repetition
  • Next by thread: Re: Javascript focus on text field in repetition
  • Index(es):
    • Date
    • Thread