Hello All,

I'm sure the answer to this is quite simple but I am just not getting it.

I have an existing javascript menu where the user selects a meaning from a drop down box and a list of products with that meaning appear in a search results page.

I had the whole javascript pasted into one of the columns where I wanted the 'search by meaning' box to appear and it worked fine, however when I tried to validate the HTML (4.01 strict) it popped up errors left and right because it was interpreting the script as HTML.

I don't know how to write js or work arounds, so I removed the whole script from the page and saved it in a .js file, but I am doing something wrong because I cannot get the javascript to appear at all, nevermind getting it to appear in the column I want it to.

Below is the javascript itself:

Code:
<script>
<!-- Begin

function selectaplace(form) {

var appname= navigator.appName;

var appversion=parseInt(navigator.appVersion);

if (appname == "Netscape" && appversion >= 3) {

var formindex=form.bymeaningsearch.selectedIndex;

var storage=form.bymeaningsearch.options[formindex].text;

if (form.bymeaningsearch.options[formindex].value != "none") {

var msg=storage+"You are now being transferred to the -> "+storage;

for (var spot=0;spot<msg.length-storage.length;spot++) {

var x=msg.substring(spot,msg.length);

form.bymeaningsearch.options[formindex].text=x;

for(var d=0;d<150;d++) { };

}

window.location=form.bymeaningsearch.options[formindex].value;

form.bymeaningsearch[formindex].text=storage;

} else  {

form.bymeaningsearch[formindex].text="Not a real option!";

for(var d=0;d<1250;d++) { };

form.bymeaningsearch[formindex].text=storage;

   }

}

else {

var formindex=form.bymeaningsearch.selectedIndex;

window.location=form.bymeaningsearch.options[formindex].value;

   }

}

function makeMyMenu() {

document.write ('<form><select name="bymeaningsearch" onChange="selectaplace(this.form)" size=1>');

document.write ('<option value="">Select Meaning');

document.write ('<option value="/SearchResults.asp?Search=attract">Invoke Attraction');

document.write ('<option value="/SearchResults.asp?Search=beauty">Invoke Beauty');

document.write ('<option value="/SearchResults.asp?Search=confidence">Invoke Confidence')

document.write ('<option value="/SearchResults.asp?Search=creativity">Invoke Creativity');

document.write ('<option value="/SearchResults.asp?Search=fertility">Invoke Fertility');

document.write ('<option value="/SearchResults.asp?Search=friend">Invoke Friendship');

document.write ('<option value="/SearchResults.asp?Search=luck">Invoke Good Fortune');

document.write ('<option value="/SearchResults.asp?Search=wish">Invoke Granting of Wishes');

document.write ('<option value="/SearchResults.asp?Search=happ">Invoke Happiness');

document.write ('<option value="/SearchResults.asp?Search=health">Invoke Health');

document.write ('<option value="/SearchResults.asp?Search=intuit">Invoke Intuition');

document.write ('<option value="/SearchResults.asp?Search=know">Invoke Knowledge');

document.write ('<option value="/SearchResults.asp?Search=lead">Invoke Leadership');

document.write ('<option value="/SearchResults.asp?Search=long">Invoke Long Life');

document.write ('<option value="/SearchResults.asp?Search=love">Invoke Love');

document.write ('<option value="/SearchResults.asp?Search=lust">Invoke Lust');

document.write ('<option value="/SearchResults.asp?Search=magick">Invoke Magickal Ability');

document.write ('<option value="/SearchResults.asp?Search=prosperity">Invoke Prosperity');

document.write ('<option value="/SearchResults.asp?Search=protection">Invoke Protection');

document.write ('<option value="/SearchResults.asp?Search=psychic">Invoke Psychic Ability');

document.write ('<option value="/SearchResults.asp?Search=travel">Invoke Safe Travels');

document.write ('<option value="/SearchResults.asp?Search=strength">Invoke Strength');

document.write ('<option value="/SearchResults.asp?Search=success">Invoke Success');

document.write ('<option value="/SearchResults.asp?Search=obstacles">For Surmounting Obstacles');

document.write ('<option value="/SearchResults.asp?Search=dream">Invoke Sweet Dreams');

document.write ('<option value="/SearchResults.asp?Search=wealth">Invoke Wealth');

document.write ('<option value="/SearchResults.asp?Search=wisdom">Invoke Wisdom');
document.write ('</select>');
document.write ('</form>');
}
makeMyMenu();
// End -->
</SCRIPT>

Can someone please tell me how I can get the page to link to the .js and place the script in the place where I want it to show?

Thanks in advance.