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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:37:11+00:00 2026-06-01T22:37:11+00:00

I have a drop down that I select a file type from, I then

  • 0

I have a drop down that I select a file type from, I then want it to fire at a page that generates a file depending on what was selected and forces a download of it using header in php. Here’s the jQuery.

$('#exportdropdown').change(function(){
var searchinput = $('#searchinput').val();
var maxrec = $('#navdropdown option:selected').text();
    $('.loadCont').fadeIn();
    if($('#importbutton').hasClass('clickedButton')){
        $.get('export.php', {filter: 'import', maxrecords: maxrec, type: 'xls'});
    }else{
        $.get('export.php', {filter: 'export', maxrecords: maxrec, type: 'xls'});
    }
    $('.loadCont').delay('600').fadeOut();
});

I’m forcing the type at the moment for testing, but it doesn’t seem to work how I expected. When you address the file with the data below so export.php?filter='import'&maxrecords=15&type='xls' it forces the download fine. Just not using the jQuery method. Anything obvious that stands out to someone more experienced?

  • 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-01T22:37:12+00:00Added an answer on June 1, 2026 at 10:37 pm

    Ajax is pointless here, all you are doing is requesting a link which pushes a file to your browser. Try:

    window.location.href = "export.php?filter=" + filter + "&maxrecords=" + maxrecords + "&type=" + type;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna have a drop down that lets me select Week Commencing Monday the
I have a <select> drop down that I'm inserting into my HTML via jQuery.
i have a form that has a multiple select drop down. a user can
I have a drop down menu that looks great when the page it scrolled
Lets say that I have a drop down list that I want to create
I'm using classic asp, I have a drop down list that the user selects
I have a drop down list that has options that need to be passed
I have a drop down list that triggers an updatepanel when the index is
I have a drop down list that is populated with data in the code
I have the following code that populates two drop down lists, it all works

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.