Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q171

Feedback on: irt.org FAQ Knowledge Base Q171

Sent by Tracy Blevins on September 13, 2000 at 09:01:30: - feedback #1749

Worth:
Very worth reading

Comments:
This article was very helpful in solving my problem. I did find one minor bug that is fixed by setting pos=1 instead of pos=0 in the else condition of if(found). Without this change the first instance of the text to find is found twice after going through the entire document once. Thanks to the person who submitted this script.


Sent by Eric on October 18, 2000 at 09:00:24: - feedback #1878

Worth:
Worth reading

Comments:
Found script useful but would suggest a few improvements:

1. Most of the stuff in the else section of the top script was unnecessary, all it really needed to do was reset pos to 0. Would also have been nice to have added an alert to tell the user that the item wasn't found. I added two, one that came up if there'd been a previous find and one if not. Mine looked like this this (though note that my form name is different):
if (pos == '0') alert('"' + document.searchform.searchtext.value +'" was not found on this page.');
else alert('No further occurences of "' + document.searchform.searchtext.value +'" were found.');
pos=0;

Also, if you search for something and it IS found, the variables are not reset. This is appropriate if one searches for the same item again, but if one types a new item into the search field, they still aren't reset, so you get inappropriately told that the new item isn't found... need to find a way to reset this if one changes the search string.


Sent by Johs. Lind on December 17, 2001 at 10:20:36: - feedback #3425

Worth:
Very worth reading

Comments:
I am happy to have found this script (171). I am now using it on this address:
www.esbjergselv.dk/vejviser/soeg.htm, with certain modifications so that it can search several files (in 2 groups,
one for voluntary social organisations and one for public institutions in our town.

But can it be true that it is impossible to make such a script for Netscape 6? I have tried my best, but cannot find
any solution.




Sent by Lee on January 23, 2002 at 10:45:40: - feedback #3514

Worth:
Worth reading

Comments:
document.write('<input type="text" name="mytext" onChange="javascript: pos = 0">');




©2018 Martin Webb