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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:13:29+00:00 2026-05-15T11:13:29+00:00

I am working on a web page that offers a form with a dropdown

  • 0

I am working on a web page that offers a form with a dropdown list to view data from a different year. The year is part of the URL routing that is configured. When the page loads, the URL can be something like: activitylog/department/year.

When the form is submitted on this page, the URL does not change, even though the user has selected a different year to view. Everything seems to actually be working correctly. When the year is changed from 2010 to 2008 on the form, the correct information for 2008 is displayed from the web server.

However, the URL displayed in the browser continues to display 2010. While this is not a real problem, I feel like it would be nice to display the direct URL for this particular dynamic page, ie: activitylog/IT/2008.

What is the preferred method to handle something like this? I believe I could use JQuery to capture the form submit, and generate the new URL using the year selected.

Is there a method built into MVC that could handle this that I am overlooking?

  • 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-05-15T11:13:30+00:00Added an answer on May 15, 2026 at 11:13 am

    You could use jQuery to modify the form action before submitting:

    $(function() {
        $('#idofyourform').submit(function() {
            var selectedYear = $('#idofyeardropdown').val();
            this.action = this.action.replace(/\/[\d]{4}$/, '/' + selectedYear);
            return true;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a web page that is using jQuery. I have an
Currently I am working on a web page that has six ReportViewer controls that
I am working on an ASP web page that handles file uploads. Only certain
I'm working on a web page where I'm making an AJAX call that returns
I am building a utility page for a web app that I am working
I am working on a web application in Java which gets data from servlets
I am working on a web page that has a reference to jquery and
I'm attempting to get my first ASP.NET web page working on windows using Mono
I'm working on updating a classic ASP web page used by a number of
I'm working on a 10 page web site with a database back-end. There are

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.