• 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 / WOBuilder Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaScript / WOBuilder Question


  • Subject: Re: JavaScript / WOBuilder Question
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 2 Mar 2007 21:14:24 -0800

Hi John,

I just happen to have it sitting in front of me. :-) Try this for you body tag. It should be 100% generic and work on any form.

<body onLoad="if (document.forms.length == 0) return; inputs=document.forms[0].getElementsByTagName('input'); for (inputIdx=0; inputIdx < inputs.length; inputIdx++) { anInput = inputs [inputIdx]; if (anInput.type.toLowerCase() == 'text') {anInput.focus (); break; }}">



Chuck


On Mar 2, 2007, at 9:08 PM, John Shepardson wrote:

I asked my first question a week ago and I would like to thank the list for
all of the help I received.


This is a really easy one and has to do with JavaScript in WOBuilder.

I have a WOTextField with one binding which is value myTextFieldValue

I want to activate this textfield by calling focus(); during the onload
event in JavaScript.
I tried to add a binding to the text field to call a JavaScript function for
the attribute onload, but it never fired.
After a little study, I deleted that binding and added the onload binding to
the <body> of the main.wo field, so now the event is firing, but I'm not
sure how to activate the textfield.


I have used
function activateTextFieldValue() { document. myTextFieldValue.focus();}
and
function activateTextFieldValue() { this.myTextFieldValue.focus();}


But the text field remains not focused.

Could someone help me to write this function into my javascript file (I know
it runs because
function activateTextFieldValue() { alert("test");}
does work.


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:
40global-village.net


This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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 / WOBuilder Question
      • From: Mike Schrag <email@hidden>
References: 
 >JavaScript / WOBuilder Question (From: John Shepardson <email@hidden>)

  • Prev by Date: JavaScript / WOBuilder Question
  • Next by Date: Re: JavaScript / WOBuilder Question
  • Previous by thread: JavaScript / WOBuilder Question
  • Next by thread: Re: JavaScript / WOBuilder Question
  • Index(es):
    • Date
    • Thread