Re: [htdig] restrict


Alain Zürcher (AZurcher@ifrance.com)
Tue, 12 Oct 1999 21:11:19 +0200


Fraser Campbell wrote (on 08/23/99!) :

<<Allow user defined (and changeable) restrict:
The problem is that I have created a drop down menu to restrict searches
based
on site. This sets the restrict to the appropriate site but I would like
the
drop down menu to appear on the search results pages as well so that people
could simply switch the site selected and click search to perform their
search
on another web site. Also the drop down would have to display the
previously
selected web site for the search to work right.>>

You can have the drop down menu display the previously selected restrict
with a JavaScript function that you call by onLoad="restrict()" in the BODY
tag, such as :

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
function restrict() {
 if("$RESTRICT"=="exosPhy/") {
  document.recherche.restrict[1].selected=true;
 }
 else {
  if("$RESTRICT"=="exosVoc/") {
   document.recherche.restrict[2].selected=true;
  }
  else {
   if("$RESTRICT"=="articles/") {
    document.recherche.restrict[3].selected=true;
   }
   else {
    if("$RESTRICT"=="contribu/") {
    document.recherche.restrict[4].selected=true;
    }
   }
  }
 }
}
//-->
</SCRIPT>

You can see such a JS function implemented on
http://chanteur.net/rechSite.htm.

| Alain Zürcher, Paris, France
| L'Atelier du Chanteur :
| http://chanteur.net

------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig@htdig.org containing the single word unsubscribe in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Sat Oct 23 1999 - 09:47:49 PDT