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

  • SEARCH
  • Home
  • 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 8093165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:26:43+00:00 2026-06-05T20:26:43+00:00

url : http://localhost/back-office/index.php/staff/shopping when i change the category on every onchange event i want

  • 0

url : http://localhost/back-office/index.php/staff/shopping

when i change the category on every onchange event i want the url should be like this

http://localhost/back-office/index.php/staff/shopping/1
http://localhost/back-office/index.php/staff/shopping/2

for that i wrote javascript on change event

function cat()
{
    var x = document.getElementById('cat').value;   
    document.location = "shopping/" + x;


}


     <select name="cate" id="cat" onchange="cat()">
        <option value="0">Select Cateogry</option>
        <?php 
        foreach($get_cat as $category)
        {
            echo "<option value=$category->categoryid>$category->category</option>";            
        }
        ?>    
    </select> 

the javscript works , but the url getting appended like

http://localhost/back-office/index.php/staff/shopping/shopping/2

http://localhost/back-office/index.php/staff/shopping/shopping/shopping/shopping/shopping/shopping/1

on every cagetory drop box onchange event the url is getting appended like this at the end.

how could i solve this

  • 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-05T20:26:44+00:00Added an answer on June 5, 2026 at 8:26 pm

    you need to specifically code your url..try this

    function cat()
    {
        var x = document.getElementById('cat').value;   
        url  = "http://localhost/back-office/index.php/staff/shopping/" + x;
        window.location = url;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to run the HelloServlet by the url: http://localhost:8080/HelloServlet . but it
I have this model var Item = Backbone.Model.extend({ url: 'http://localhost/InterprisePOS/Product/loaditembycategory/Event Materials' }); var onSuccess
I have a url like http://localhost/uploaded_server_alert/backup/alertR/business/business-registration.php?back_abn=2342&back_add1=#asdas I want to fetch the back_add1 value in
URL url = new URL(http://localhost:8080/Work/images/abt.jpg); InputStream in = new BufferedInputStream(url.openStream()); ByteArrayOutputStream out = new
I have the following url http://localhost/user/MyUserName How do I get MyUserName from that url?
I have the following URl: http://localhost:12981/BaseEvent/EventOverview/12?type=Film This is route: routes.MapRoute( Default, // Route name
When I try to go to this url: http://localhost:3000/lessons/18/pages , I get this error:
How can I do a Redirect Rule that transforms this URL: http://localhost/app/Company/HomePage.aspx?COMPANYID=2&FORCESHOWCASE=TRUE&THEMEPREVIEW=3 to this
I have a web service contains a web method with the url http://localhost/Service1.asmx?op=AddNumbers .
private function loadGallery():void { theSend.url = http://localhost/userMana/file.xml; theSend.send(); } I am calling this XML

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.