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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:31:00+00:00 2026-05-20T17:31:00+00:00

EDIT I am still baby in writing Javascript and I need your help in

  • 0

EDIT

I am still baby in writing Javascript and I need your help in understanding how it works so please bear with me.

Say, if I want to have “Singapore” append to the textfield on the webpage automatically when the user picks “Singapore” in country select dropdown, how or where do I need to append the “Singapore” text to the state/city textfields on webpage? See image example.

enter image description here

HTML code

enter image description here

Javascript

function appendtoText(){

var country = document.getElementById("billing_country_select");
var state = document.getElementById("billing_province_input");
var city = document.getElementById("billing_city");
if (country.value == "Singapore"){

    state.value = state.append("Singapore");
    alert(state.value);
    city.append("Singapore");

}

}

I am not sure where I went wrong with this. State and City don’t show the appended text: Singapore. So please correct me if I went wrong in coding.

Thanks for the help in advance

  • 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-20T17:31:00+00:00Added an answer on May 20, 2026 at 5:31 pm

    To add the value of the Country field to the state field:

    $(document).ready(function() {
        $('$billing_country').change(function() {
            $('$billing_province_input').val(' - ' + $('$billing_country').val());
        });
    });
    

    When the Billing Country field is changed, the Billing State/Province value automatically becomes ” – Billing Country“. If the chosen country were Singapore, it would become ” – Singapore”. I’m making a very simple assumption about how you want this to work, so if this isn’t what you need, let me know and I will refine it as needed.

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

Sidebar

Related Questions

I'm not a designer but I sometimes have to create/edit images for our applications.
I'm currently displaying a random row from all the entries and that works fine.
Say I create two sets of tuples like so: Dim losSPResults As List(Of spGetDataResults)
I call a javascript function from a textbox by using OnKeyPress=clickSearchButton() Here is my
More specifically, what do I need to know about doing this in Visual Studio
After upgrading to the newest GWT/Google app engine I have problems opening my workspace
OK, this isn't really a question to achieve anything practical, but still it is
Can anyone help me trying to find out why this doesn't work. The brushes
Edit 4: I was finally able to solve my own issue. See checkmark answer
I stumbled on a way to crash excel in Workbook_Open while making an .xla

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.