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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:22:00+00:00 2026-06-03T17:22:00+00:00

So, my hope was to create a checkbox that upon clicking would call a

  • 0

So, my hope was to create a checkbox that upon clicking would call a function to populate values of one part of a form into another. This is useful when creating a button that says “Use my Main Address” for the Billing or Shipping address. Javascript wise, I’ve created this:

function fillBilling() {
    if (document.getElementById('useMain').checked) {
        document.getElementById('ccFName').value = document.getElementById('firstName').value;  
        document.getElementById('ccLName').value = document.getElementById('lastName').value;  
        document.getElementById('ccAddr1').value = document.getElementById('address1').value;  
        document.getElementById('ccAddr2').value = document.getElementById('address2').value;
        document.getElementById('ccCity').value = document.getElementById('city').value;
        document.getElementById('ccZip').value = document.getElementById('zip').value;
        document.getElementById('ccState').innerHTML = document.getElementById('state').innerHTML;
    }
}

And you know… it works perfectly in Firefox. I’ve used “innerHTML” in the case of the state code because the state code is selected via dropdown, as opposed to a text input.

I’ve seen how there is a problem with innerHTML with regard to tables, but… this isn’t a table. It’s a SELECT tag. Is there a workaround? I’m not looking to add options to the select statement, but in a perfect world, I’d make the same selection from the “state” to the “ccState” value. They’re both populated from the same table, so the list of possible values is identical. Suggestions?

  • 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-03T17:22:02+00:00Added an answer on June 3, 2026 at 5:22 pm

    If they’re identical, try updating just the selectedIndex

    document.getElementById('ccState').selectedIndex =
        document.getElementById('state').selectedIndex;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to create an app that allows voice recording. i hope to call
I'm trying to create a function in package that returns a table. I hope
I hope to create a single app that supports both the iPhone and the
hey people hope all is well.. i am trying to create a form in
I hope this will make sense: I need to create a foreach function in
I hope I get this one straight: I try to create an JSF 2.0
I need to create a sprite graphic, I hope that's the right name for
This may already exist I hope. I want to create a Windows service that
I'm newbie programmer building a startup that I (naturally) hope will create a large
I want to create a simple form that displays data items from database and

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.