> >i need it to be activated by an onclick event by a button that isnt in
the
> >form.
> > Why can't the button be in the form?
> > >my scripts look like...
><SCRIPT>
> >function leapto()
> > {top.location=document.form['formtwo'].dest.options[myindex].value; }
> ></SCRIPT>
> ><form name="formtwo" action=""><SELECT NAME="dest" SIZE=1>
> ><option SELECTED VALUE="#">Regional Outlets</option>
> ><option VALUE="http://www.newmediadesigns.co.uk">link one</option>
> ><option VALUE="http://www.andel.co.uk">link two</option>
> ></SELECT></form>
> >
> ><a href="javascript://" onClick="leapto()"><img src="images/b-go.gif"
> >width="64" height="40" alt="submit this search" class="imgover"
> >border="0"></a>
>
> So many things wrong with this in principle, before we even get to
> your coding problem. It fails totally if JavaScript is not enabled.
> The alt attribute is misleading (this is not a search). It looks like
> a form but it's really just a user unfriendly way of rendering a list
> of ordinary links.
>
> Still, I doubt that you're interested in any of that. You just want a
> quick fix to your superficial problems.
>
> <script type="text/javascript">
> function leapto() {
> for (i=0; i < document.getElementById("dest").options.length; i++) {
> if (document.getElementById("dest").options[i].selected == true) {
> top.location=document.getElementById("dest").optio ns[i].value;
> }
> }
> return false;
> }
> </script>
>
> <form action="navpage.html" method="get" onSubmit="return leapto()">
> <SELECT id="dest" NAME="dest">
> <option SELECTED VALUE="#">Regional Outlets</option>
> <option VALUE="http://www.newmediadesigns.co.uk">link one</option>
> <option VALUE="http://www.andel.co.uk">link two</option>
> </SELECT>
> </form>
>
> <a href="navpage.html" onClick="return leapto();"><img
> src="images/b-go.gif" width="64" height="40" alt="something
> useful"></a>
>
> The navpage.html should contain the same links as your dropdown but as
> a standard list of links, so that users without JavaScript can still
> get to the pages in question.
thanks ste'
thanks for the rescue! i appreciate your comments and think the work-around
is excellent.
mark
|