Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 828
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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