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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:18:18+00:00 2026-05-20T05:18:18+00:00

could someone help me to figure out if it is possible to take part

  • 0

could someone help me to figure out if it is possible to take part of the value entered into an input field and change the value. What I am trying to do is make sure that addresses are entered correctly. So if someone puts in:

111 Circleview Road it would be changed to 111 Circleview Rd.

This is what I am trying with but having no luck, so I don’t know if I am doing this wrong or if this is not possible to do with jQuery

$("#address").blur(
function(){
  switch ($(this).val()){
    case 'Road':
    case 'road':
        $(this).replaceWith("Rd.");
    break;
    case 'Street':
    case 'street':
        $(this).replaceWith("St.")
    default:
        $(this).val();
    break;
   }
  }   
);
  • 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-20T05:18:19+00:00Added an answer on May 20, 2026 at 5:18 am

    Just use regular expression to find the words – it’s just string manipulation in JavaScript.

    $("#myinput").blur(function(){ 
       this.value = this.value
           .replace(/[Rr]oad/g,'Rd.')
           .replace(/[Ss]treet/g,'St.');
    });
    

    Example: http://jsfiddle.net/jonathon/4Yuym/

    You don’t need to use $(this).val() on an input element since value is part of the element’s native properties – so you can use this.value to get/set.

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

Sidebar

Related Questions

I was hoping someone could help me figure out how to change the setmessage
Could someone help me figure out how to get the hslide value in Flash
I wonder if someone could help me figure out how to parse a string
I got a problem I was hoping someone could help me figure out! I
hoping someone can help me out with this. I'm trying to figure out whether
Could someone help me to figure out with dependency property system in WPF?! I
I was wondering if someone could help me figure out how I can find
Hi could someone help me figure out how to stop a function running until
Could someone please help me figure out what is wrong with my program, AND
EDIT: I added a bounty, if someone could help me figure out what I

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.