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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:23:18+00:00 2026-06-11T11:23:18+00:00

Im populating a form selected options via a mysql query. The result looks something

  • 0

Im populating a form selected options via a mysql query.

The result looks something like this :

<form method="get" action="">

  <select name="recordlabel" onChange="submit()">
    <option selected="selected"></option>
    <option value="1">COLUMBIA</option>
    <option value="2">SONY</option>
    <option value="3">EMI</option>
  </select>

</form>

When I select an option, it automatically submits the form and looks like this:

http://www.mysite.com/?recordlabel=3

What i want is to use friendly url and should look like this:

http://www.mysite.com/recordlabel/emi.3

http://www.mysite.com/recordlabel/columbia.1

Now, i know that i need to use mode_rewrite… that i have no problemo and looks like this:

RewriteRule ^/recordlabel/.*\.([0-9]+)$ /mysite.com?recordlalel=$1 [L]

The part that i don’t get is how do i format the string so it looks like a friendly url onChange() How do i achieve that?

  • 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-11T11:23:20+00:00Added an answer on June 11, 2026 at 11:23 am

    You would need to use javascript to submit your form instead of relying on native submit.

    If you’re using jQuery, you can do this (untested):

    $("form").submit(function(e){
      e.preventDefault();
      var formData = $(this).serialize();
      $.get('/recordlabel/'+formData.recordLabel', function(data){
       //do something with response data.
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK so I'm populating a selectbox with a JSON which looks something like this:
I had thought I would use curl for this but it looks like I
i am populating a form from mysql. code is. . task.php <div data-role=content> <h2>
I am populating a DataGridView control on a Windows Form (C# 2.0 not WPF).
I'm using a form where the user can edit an entry. Everything is populating
I'm using jqWidgets with ASP.MVC. I am populating a dropdown list, when the form
I'm populating my select box using the query shown below: <%=f.select :acoustic, options_for_select(User.includes(:roles).where( :roles
I am populating form variables from a database. If the field value has a
How does one pre-populate a Formish form? The obvious method as per the documentation
How do I retain form values upon submit for a loop? I've got something

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.