Is there a way to make the input field 'active' as soon as the page opens - whether it's the main form page or just a simple form?
Tim
David's suggestion above was for search forms created by the user (http://www.wrensoft.com/zoom/support/faq_howto.html#searchform) (in HTML).
An alternative method that would not require a form name (and thus, not require editing the search script) would be the following: Particletree » Lightbox Gone Wild!:: Feb 1, 2006 If you want to switch the focus to the lightbox add this to the displayLightBox function . Is there a way to automatically display a light box on page load? I fixed this with css. Just set the cursor for your text fields. However when you click inside an input box, a flashing cursor http://particletree.com/features/lightbox-gone-wild/HOME | Struts-Layout - Improve Struts-Layout : skin configuration:: error.focus, Set the focus on the first error field. Default is false. numberOfMenusLoaded, Number of menus to load at once in the treeview. autoskip.active, Enable skip to next field when a field maxlength is reached. that can be used by setting the model attribute of the input field tags to "myModel". http://struts.improve-technologies.com/configuration.htmlHOME |
For more information on using Javascript with forms, check out this page (http://home.cogeco.ca/~ve3ll/jstutor4.htm) (also try a search on Google).
Ray
Thank you for this line of code and the referral. I will look into converting to this method in the future.
I am trying to achieve the same effect as tj, however, I am using .asp. The browser does not default the cursor either, as was suggested by David and although I have tried applying David's solution (in the body of search_template.html file) I do not get a cursor defaulting to the search box ready for users to input their text.
In the search.asp file the form is not named :-
Response.Write("") & VbCrlf
Response.Write(STR_FORM_SEARCHFOR & " ") & VbCrlf
Any suggestions on how this could be achieved? I have viewed in IE, Netscape 6.1 and Firefox and get the same results with all.
I thought I'd try adding the missing form name and apply David's solution to the search_template.html file and hey presto I now have the cursor blinking away in the search input box! (I remembered to use ZoomIndexer to make the change to the search.asp file)
Response.Write("") & VbCrlf
Response.Write(STR_FORM_SEARCHFOR & " ") & VbCrlf
I hope this helps anyone else who has encountered a similar need.
The browser will normally do this for you. So it is not normally required.
However if you want to change the default browser behaviour you need to use some additional Javascript code to do this.
For the sake of an example, imagine that this was your Zoom search form,
Then you could use Javascript like this to set the position of the cursor (the focus) by adding an onLoad attribute to the tag.
--------
David
WrenSoft
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|