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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:21:47+00:00 2026-06-10T20:21:47+00:00

<script type=text/javascript> var CountryVal; var StateVal; $(document).ready(function(){ $(‘#ItemCountry’).change(function(){ CountryVal = this.value; // value of

  • 0
<script type="text/javascript">
var CountryVal;
var StateVal;
$(document).ready(function(){
    $('#ItemCountry').change(function(){
        CountryVal = this.value; // value of the select element
        $("#StateFeeder").html('<img src="/images/mapCountry/AU/ajax-loader.gif" class="IMG-Loading" />');
        $('#StateFeeder').load('/StateFeeder/StateFeeder-Buy.html #StateFeeder-'+CountryVal, function(){
            $('#ItemState').change(function(){
                StateVal = this.value; // value of the select element
                $("#CityFeeder").html('<img src="/images/mapCountry/AU/ajax-loader.gif" class="IMG-Loading" />');
                $('#CityFeeder').load('/Country/'+CountryVal+'/_'+CountryVal+'_suburbs.html #Suburbs-'+StateVal, function(){
                    $('#CityFeeder select').attr('size', '5');
                    $('#CityFeeder select').change(function(){  
                        this.form['CAT_Custom_221342'].value=$(this).val();
                    }); 
                });        
            })
        });
    });
});           
</script>

The Jquery above will load dropdown menu from other page into current page and pass value into another input field when user makes selection. The problem is, the option value taken from the #StateFeeder in remote page contains the below format:

<option value="Kabardino-BalkarRepublic">Kabardino-Balkar Republic</option>
<option value="Karachay-CherkessRepublic">Karachay-Cherkess Republic</option>
<option value="KareliaRepublic">Karelia Republic</option>
<option value="KomiRepublic">Komi Republic</option>
<option value="MariElRepublic">Mari El Republic</option>
<option value="MordoviaRepublic">Mordovia Republic</option>

the values above are nonstop capitalized words and I want them to be formated with spaces in between capital words like below (plz keep the “-” btw words)when they are loaded into the current page, special concern in #ItemState part: when city values are loaded into #ItemState menu,e.g. “KareliaRepublic” the values(without space “KareliaRepublic”) is considered as id so that remote menu can be properly loaded, please format it until this load process completed then process the add space action. thank you very much:

<option value="Kabardino-Balkar Republic">Kabardino-Balkar Republic</option>
<option value="Karachay-Cherkess Republic">Karachay-Cherkess Republic</option>
<option value="Karelia Republic">Karelia Republic</option>
<option value="Komi Republic">Komi Republic</option>
<option value="Mari El Republic">Mari El Republic</option>
<option value="Mordovia Republic">Mordovia Republic</option>
  • 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-10T20:21:48+00:00Added an answer on June 10, 2026 at 8:21 pm

    This should work:

    value = value.​​replace(/([^-])([A-Z])/g, "$1 $2");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
<script type=text/javascript> $(document).ready(function() { $('.ibutton').click(function() { var ajaxdata=$(#country).val(); var value = country=+ajaxdata; $.ajax({ url:
I have fetched json through <script> function getjs() { var script =document.createElement(script); script.setAttribute(type,text/javascript); script.setAttribute(src,http://localhost:8080/vigs/f4json?user=3&callback=gr);
Look this code: <script type = text/javascript> function mouseClick (container) { container.appendChild (document.createTextNode (Can
The code is like this: var script = document.createElement('script'); //script.type = 'text/javascript'; // do
#!/usr/bin/perl print Content-type: text/html \n\n; print qq(<html> <head> <script type=text/javascript src=/jquery.js></script> <script> jQuery(document).ready(function(){ jQuery(#form_lang).submit(function(e){
< script type = text/javascript > $(function() { var oAllLinksTable = $(#mydatatable).dataTable({ bProcessing: false,
Below is the code for my YWA wrapper var astr_ywascript = (document.createElement(script).type = text/javascript).src
var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://www.mydomain.com/bleh.php'; script.id =
<div id="myLuckyPost"> </div> <script type="text/javascript"> function showLucky(root){ var feed = root.feed; var entries =

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.