Here are the steps I followed to successfully implement this search box.
1. On database properties --> First tab select from Web Access section and
enable "Use Java Script when generating pages"
2. Also on database properties --> 2nd from last tab --> create index
3. Go into designer and create your subform (i.e. Shared code --> Subforms)
4. once in your new subform
a. Create a field name (Query) ** keep in mind of the case (javascript is
case sensitive)
b. Copy this code into your subform and make all text pass-thru html. Do
not include the ** lines in your sub form.
function doSearch ( s ) {
openDbRelativeURL("All?SearchView&Query=" + s.value);
}
function openDbRelativeURL( url, target ){
//Check we have a target window;
target = (target == null ) ? window : target;
//Work out the path of the database;
path = location.pathname.split('.nsf')[0] + '.nsf/';
target.location.href = path + url;
}
6. make sure you change the word "All" to the name of your view.
7. Save the subform
8. Add subform to your form
And that is all I did to make it work. I hope this will help in implementing
this search.
Here are the steps I followed to successfully implement this search box.
1. On database properties --> First tab select from Web Access section and enable "Use Java Script when generating pages"
2. Also on database properties --> 2nd from last tab --> create index
3. Go into designer and create your subform (i.e. Shared code --> Subforms)
4. once in your new subform a. Create a field name (Query) ** keep in mind of the case (javascript is case sensitive) b. Copy this code into your subform and make all text pass-thru html. Do not include the ** lines in your sub form.
** beginning of code <style type="text/css"> <!-- .style5 { font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #330066; font-weight: bold; } --> </style>
<table width="409" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="62"><span class="style5">Search</span></td> <td width="269"> <input type="text" name="Query" size="40" /> </td> <td width="78" colspan="3">   <input type="button" name="Search" value="GO!!" onclick="doSearch(this.form.Query);"/> </td> </tr> </table>
** end of code
5. go to JS Header of subform and copy this code.
function doSearch ( s ) { openDbRelativeURL("All?SearchView&Query=" + s.value); }
function openDbRelativeURL( url, target ){ //Check we have a target window; target = (target == null ) ? window : target; //Work out the path of the database; path = location.pathname.split('.nsf')[0] + '.nsf/'; target.location.href = path + url; } 6. make sure you change the word "All" to the name of your view.
7. Save the subform 8. Add subform to your form
And that is all I did to make it work. I hope this will help in implementing this search.
Thank you Codestore for step by step lesson.
Ted Ford