Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:58:54+00:00 2026-06-01T13:58:54+00:00

I have a few cascading dropdowns on the bottom of my php page. Each

  • 0

I have a few cascading dropdowns on the bottom of my php page. Each time a user selects an option from the dropdown the following function is called to add the value of that option to my url variables. Currently the page refreshes to the top each time which is a huge problem. Normally I would use something like onCLick=”window.location=’page.htm#bottom’;” to refresh to the bottom of the page but the below function stops working when I add the #bottom. Can someone help me adjust this function or give me other ideas that will refresh to the bottom of the page when the function is done.

function reload5(form){
if(document.getElementById('fda1').checked) {
 var fda = '1';
}else if(document.getElementById('fda0').checked) {
  var fda = '0';
}

var val=form.category.options[form.category.options.selectedIndex].value; 
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
var val3=form.subcat1.options[form.subcat1.options.selectedIndex].value;
var val4=form.subcat2.options[form.subcat2.options.selectedIndex].value;
var comp1=form.mname.options[form.mname.options.selectedIndex].text;
var itemnum=document.getElementById('item').value; 
var desc=document.getElementById('desc').value;
var quan=document.getElementById('quan').value;
var list=document.getElementById('list').value;
var uom=form.uom.options[form.uom.options.selectedIndex].text;
self.location='add_products.php#bottom?fda=' + fda + '&desc=' + desc + '&quan=' + quan + '&list=' + list + '&uom=' + uom + '&item=' + itemnum + '&cat=' + val + '&cat2=' + val2 + '&cat3=' + val3 + '&cat4=' + val4 + '&comp=' + comp1 ;
}

So this doesn’t work: self.location='add_products.php#bottom?fda=' + fda

But this does : self.location='add_products.php?fda=' + fda

Any idea where to put the #bottom?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:58:55+00:00Added an answer on June 1, 2026 at 1:58 pm

    The issue is that the hash must come after the query string at the end. See this article. Try this… (I also cleaned up the code)

    function reload5(form){
        var val=form.category.options[form.category.options.selectedIndex].value,
            val2=form.subcat.options[form.subcat.options.selectedIndex].value,
            val3=form.subcat1.options[form.subcat1.options.selectedIndex].value,
            val4=form.subcat2.options[form.subcat2.options.selectedIndex].value,
            comp1=form.mname.options[form.mname.options.selectedIndex].text,
            itemnum=document.getElementById('item').value,
            desc=document.getElementById('desc').value,
            quan=document.getElementById('quan').value,
            list=document.getElementById('list').value,
            uom=form.uom.options[form.uom.options.selectedIndex].text,
            fda;
    
        if(document.getElementById('fda1').checked) {
             fda = 1;
        } else if(document.getElementById('fda0').checked) {
             fda = 0;
        } else {
             fda = -1;
        }
    
        window.self.location.href = 'add_products.php?fda=' + fda + '&desc=' + desc + '&quan=' + quan + '&list=' + list + '&uom=' + uom + '&item=' + itemnum + '&cat=' + val + '&cat2=' + val2 + '&cat3=' + val3 + '&cat4=' + val4 + '&comp=' + comp1 + "#bottom";
    }
    

    What I don’t understand is why you are not doing something with Ajax that would not cause the page to refresh at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few pages that I show from my main page inside iframe .
I built a cascading dropdown in jquery, modified from a few examples. I added
I have few question in this regard When you create an internet page, does
We have few components like libraries dlls When initially created I ran the following
I have few nested DIVs at page. I want to add event only for
I have few text and excel file, from which I need to import data
I have few buttons of which each button is assigned a class with a
I have few TabPages and each contains rich text box. How can I access
i have few textfields in my php form. i want to handle the keypress
I have few FOREACH loops in php; $c1 = 1; $c2 = 1; $c3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.