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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to