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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:36:58+00:00 2026-06-13T12:36:58+00:00

I have a form with several text boxes. The first input box is Business

  • 0

I have a form with several text boxes.

The first input box is “Business Name”. There are several more boxes with various information and then the final box is “URL” where I type in the url I want this business to have in my database. Instead of manually typing this url I want it to take the value of the title input box, and replaces the spaces with “-” and make it all lowercase. I also want to prefix the url.

So if I enter “Bobs Hotel”, then as soon as I am done typing the URL box would be prefilled with “business/bobs-hotel”. If I typed “Mikes Hot Dogs” it would be “business/mikes-hot-dogs”, etc and ready for me to submit the form.

EDIT: I forgot an important detail:
The word “business” isnt actually going to be used. The word to use is coming from a drop down select box. This box has 3-4 option names (not values), “hotel”, “Restaurant”, etc. So if you select “Hotel” from the dropdown then the URL would be “hotel/hotel-name”

One important thing is although you select “hotel” from the dropdown the value of hotel is a number, like 5 or whatever (as it corresponds to a category ID in the database)

How might I do 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-13T12:36:59+00:00Added an answer on June 13, 2026 at 12:36 pm

    Given that your inputs have id name and url, you could do something like this with jQuery:

    $("#name").on("focusout", function () {
        var business = $("#business").val();
       $("#url").val(business + "/" + $(this).val().toLowerCase().replace(" ", "-"));
    });
    

    Demo

    Update:

    Updated the example to take the value for business from a dropdown-list as well. See updated demo.

    Update 2:

    To get the content of the selected option instead of the value, you could do this instead:

    $("#name").on("focusout", function () {
        var business = $("option:selected", "#business").text();
       $("#url").val(business + "/" + $(this).val().toLowerCase().replace(" ", "-"));
    });
    

    Now we get the selected option-element within element with id business, and read its content with the .text() method.

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a combo box and several text boxes on a form. When I
I have a form with several text boxes on it. I only want to
I have several textboxes for inputs and then several more for results. Is there
VB 2008. I have several text boxes on a form and I want each
I have a form containing two text boxes for user input. Both text boxes
I have several text boxes in an ASP.NET Web Form. I want to ensure
I have one form with several text fields and one button. When i enter
I have a page with several Ajax.InPlaceEditor fields. Some are single line (text input
i currently have a form that has several check boxes, once all the boxes
Total beginner question about jQuery: I have a Form that contains several TextBoxes (input

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.