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 8796823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:42:38+00:00 2026-06-13T23:42:38+00:00

I am working on a brand filter. When I change the brand name from

  • 0

I am working on a brand filter. When I change the brand name from dropdown, I am not getting anything; it seems that no event was triggered.

Below is my code:

<select onchange="location.href=[server.url type='fullpage' query='sort=price&brand=$brand']">

<?php 
  $brands = dfr_get_brands_list($category);
foreach ($brands as $brand) : ?>

       <option><?php echo $brand; ?></option>

<?php endforeach; ?>

</select>

[server.url type='fullpage' query=''] returns the full URL of the current page, for example: http://www.mysite.com/store/category/shoes/.

  • 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-13T23:42:39+00:00Added an answer on June 13, 2026 at 11:42 pm

    You can not mix JavaScript and PHP. JavaScript runs on the client, PHP runs on the server, they can not run together.

    Break the logic out of the HTML tag and make a function, call that function onchange. Cleans up the code so it is easier to read and maintain.

    What you need to do is to change the code to add the brand dynamically to the end of the url

    function gotoPage(){
        var url = "theBaseUrlHere";
        var sel = document.getElementById("yourSelectId");
        var brand = sel.options[sel.selectedIndex].text;
        window.location.href = url + "&brand=" + brand;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a javascript filter that is working but not all the time.
I'm working on a brand new project for a state government agency that we
I'm brand new to Capistrano, working with an existing server that was previously using
i have created an IE band object (toolbar) that is working well. however, when
I'm working on a program that connects to different brands of plc's and therefor
Working with an undisclosed API, I found a function that can set the number
I am a brand new Java developer (I have been working in asp.net) and
I'm working on a rails 3.1 engine, and as it's a brand new release
I'm brand new to JAva/Eclipse/Android but gearing up! I've got everything installed and working
Brand new to Ruby. Am trying to sort a de-duplicated list of email FROM

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.