This content has been marked as final.
Show 2 replies
-
1. Re: Set focus on load of page
mpickell May 27, 2009 9:45 AM (in response to oneworld95)Try instead (requires jQuery):
(function($) { $(document).ready(function () { $("#metaform\\:txtAssetID").focus(); }); /* end of document.ready */ })(jQuery);
This waits for the page to load, and then sets focus. you version attempts to do it prior to loading (i believe) and therefore the component isn't there yet.
If you are using other javascript libraries that use the "$", don't forget to add jQuery.noConflict; when loading the jQuery library.
Although i haven't tried it yet, this script could probably be added directly to the rich:jquery component. -
2. Re: Set focus on load of page
oneworld95 May 27, 2009 9:55 AM (in response to oneworld95)Thanks, mpickell. I was wondering how to use jQuery and didn't know the syntax. That will do the trick.