Form focus on FP search

L

Larry

How do I place form focus on the searchbox of a FP2K standard search
bot? I added a name field but am not sure how to set the focus to it. I
cannot select a 'document' as there is no form name.

<!--webbot bot="Search" S-Index="All" S-Fields="Weight"
I-Size="50" S-Submit="Start Search"
S-Clear="Reset" S-TimestampFormat="%m/%d/%Y" TAG="BODY"
b-useindexserver="0" S-Text="Search for:" name="sitesearch" -->

Any help would be appreciated.
Larry
 
S

Stefan B Rusynko

The form field name use by the search webbot input field is name="search"
There is no form name so you would use the form index
(0 for the 1st form on your page)

<body onload="document.form(0).search.focus()" >
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| How do I place form focus on the searchbox of a FP2K standard search
| bot? I added a name field but am not sure how to set the focus to it. I
| cannot select a 'document' as there is no form name.
|
| <!--webbot bot="Search" S-Index="All" S-Fields="Weight"
| I-Size="50" S-Submit="Start Search"
| S-Clear="Reset" S-TimestampFormat="%m/%d/%Y" TAG="BODY"
| b-useindexserver="0" S-Text="Search for:" name="sitesearch" -->
|
| Any help would be appreciated.
| Larry
|
| --
| For your security and peace of mind ALL emails are automatically
| scanned with the latest Norton AV Virus Definitions.
| Not that I have any virus' but why not be careful!
| I get virus signature updates regularly!
| -----------------
| A Belt and Suspenders are the best security invented!
 
L

Larry

Using: <body onload="document.form[0].search.focus();" > I get different
error "document.form has no properties". I tried "forms" as well with
same result. Since my FP search box is the 2nd form on the page (first
is the time of day top right) I also tried form[1] and that gave the
same error. All this in Firefox. In IE get no error but focus doesn't
work either.

Bob said:
Try -
document.forms[0].search.focus();

Bob Lehmann
 
B

Bob Lehmann

Did you try forms[1] ?

Bob Lehmann

Larry said:
Using: <body onload="document.form[0].search.focus();" > I get different
error "document.form has no properties". I tried "forms" as well with
same result. Since my FP search box is the 2nd form on the page (first
is the time of day top right) I also tried form[1] and that gave the
same error. All this in Firefox. In IE get no error but focus doesn't
work either.

Bob said:
Try -
document.forms[0].search.focus();

Bob Lehmann


When I try this I get a javascript error "Error: document.form is not a
function" in Firefox. I added the onload command as below and
name="search" in the search form.

Url: http://www.bed-and-breakfast-travel.com/infopages/sitesearch.html


Stefan B Rusynko wrote:



The form field name use by the search webbot input field is name="search"
There is no form name so you would use the form index
(0 for the 1st form on your page)

<body onload="document.form(0).search.focus()" >




--
For your security and peace of mind ALL emails are automatically
scanned with the latest Norton AV Virus Definitions.
Not that I have any virus' but why not be careful!
I get virus signature updates regularly!

--
For your security and peace of mind ALL emails are automatically
scanned with the latest Norton AV Virus Definitions.
Not that I have any virus' but why not be careful!
I get virus signature updates regularly!
 
L

Larry

This works IE & Firefox:
<body onload="document.forms[1].search.focus();" >
Thanks for your help
Larry

Bob said:
Did you try forms[1] ?

Bob Lehmann


Using: <body onload="document.form[0].search.focus();" > I get different
error "document.form has no properties". I tried "forms" as well with
same result. Since my FP search box is the 2nd form on the page (first
is the time of day top right) I also tried form[1] and that gave the
same error. All this in Firefox. In IE get no error but focus doesn't
work either.

Bob Lehmann wrote:


Try -
document.forms[0].search.focus();

Bob Lehmann





When I try this I get a javascript error "Error: document.form is not a
function" in Firefox. I added the onload command as below and
name="search" in the search form.

Url: http://www.bed-and-breakfast-travel.com/infopages/sitesearch.html


Stefan B Rusynko wrote:





The form field name use by the search webbot input field is
name="search"

There is no form name so you would use the form index
(0 for the 1st form on your page)

<body onload="document.form(0).search.focus()" >






--
For your security and peace of mind ALL emails are automatically
scanned with the latest Norton AV Virus Definitions.
Not that I have any virus' but why not be careful!
I get virus signature updates regularly!
--
For your security and peace of mind ALL emails are automatically
scanned with the latest Norton AV Virus Definitions.
Not that I have any virus' but why not be careful!
I get virus signature updates regularly!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top