Click to See Complete Forum and Search --> : Form Trouble


mustang0721
07-16-2003, 08:52 AM
I don't know a whole lot about JavaScript so please forgive me. I have a drop down menu on several of my pages and my problem occurs when I want to change something on the menu. I have to go to each individual form and change the code.

I'm trying to make it so that I can just change one form and it will take care of all the others. I know I have to create a .js file but I really have no idea how to do that or how to import it onto the pages where I need it.

Here are excerpts from the form:

<form name="abcd">
<p align="center"><select name="a" size="1">
<option value="index2.htm">Home</option>
<option value="forum/index.htm">Leatherneck Lane Message Board</option>
<option value="reflect/index.htm">Reflections</option>
</select> <br>
<br>
<input type="button" name="Here We Go!!!"
value="Here We Go!!!" onclick="go()">
</form>
<script language="Javascript">
<!--
function go() {
document.location = document.abcd.a.options[document.abcd.a.selectedIndex].value
}
//-->
</script>

<hr size="1">


Any help is greatly appreciated.

pyro
07-16-2003, 09:30 AM
You would be better of using a language such as PHP or SSI to do this:

.php
<?PHP
include ("yourfile.htm");
?>

.shtml
<!--# include file="yourfile.htm"-->

where yourfile.htm equals the content of you menu...

mustang0721
07-16-2003, 09:38 AM
Thanks, but I'm not entirely sure what you mean. I'm supposed to save the form as a .php file? How do I do that?

And..does the <!--# include file="yourfile.htm"--> go in the html? Sorry to bug you, I'm just not really understanding what you mean. Thanks.

pyro
07-16-2003, 09:40 AM
For the first way I posted, you will need to rename all your pages with a .php extention. For the second way, you will need to rename them all to a .shtml extention. And, youfile.htm, can be yourfile.xxx -- it's just going to be the content of your menu.