[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 830
  • Last Modified:

Jump to anchor with JS

I have a page consisting of 2 frames.  One is the "list" frame and the other is the ref "frame".
In the ref frame I have a select object set up so that when I change the select object it jumps the list frame document down to the corresponding section.
This code makes Internet Explorer do this but it relaods the list page each time.

  var a = "#" +
          theForm.ID.options[theForm.ID.selectedIndex].value
          + "anchor";
  parent.list.location=a;

This code brings the browser to the right spot but as I said, it reloads the page again.  The page is too large for this to be usefull.
I need an answer as soon as possible.
Thanks,
Pete
0
pmcintos
Asked:
pmcintos
1 Solution
 
kollegovCommented:
That's because you make POST or GET action from
form submitting, you didn't post here full code
how you call this script!

but generally
you should call your function
so
<FORM onSubmit()='setNewLocation(); return false;'>

to avoid reloading.



0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now