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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:30:53+00:00 2026-06-10T19:30:53+00:00

I have an HTML table element, with rows containing not only plain-text characters, but

  • 0

I have an HTML table element, with rows containing not only plain-text characters, but also radio buttons, lists, etc.

What I would like to have, is when the user copy-pastes the content of the table into MS Excel (as plain text), the radio buttons should be replaced with their values (e.g.: “checked”, and “unchecked”), lists elements should be replaced by their selected value, etc.

Is there a way to implement this in the browser?
(Preferably without using flash or java applet components)

Thanks,
krisy

  • 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-10T19:30:55+00:00Added an answer on June 10, 2026 at 7:30 pm

    You could use javascript (this will be easier with a framework like jquery) to modify the code that has been copied. The general procedure would be to set the radio buttons to be invisible and then add in text in their place based on their current value.

    There are plenty of questions to help with the implementation details: https://stackoverflow.com/search?q=%5Bjavascript%5D+copied+text&submit=search

    Update: Turns out you don’t even need to remove the radio buttons, at least for my version of excel. Here is a working example (way over-commented to explain what’s going on):

    <!DOCTYPE html>
    <html>
      <head>
        <style type='text/css'>
          .radioCopyVal{
          font-size: 0;
          }
        </style>
      </head>
      <body>
        <form>
          <table>
        <tr>
          <td><input type='radio' name='woots' id='oneWoot' checked/><span class='radioCopyVal'>Checked.</span></td>
          <td><label for='oneWoot'>Woot.</label></td>
        </tr>
        <tr>
          <td><input type='radio' name='woots' id='twoWoot' /><span class='radioCopyVal'>Not checked.</span></td>
          <td><label for='twoWoot'>Woot. Woot.</label></td>
        </tr>
          </table>
        </form>
        <script src="jquery-1.7.2.min.js"></script>
        <script type='text/javascript'>
          $("#oneWoot").attr("checked", true); //on page load, make sure oneWoot is the default selection
    
          $("input[name=woots]:radio").change(function(){ //anytime the radio buttons of name woots are changed...
              $(".radioCopyVal").remove(); //remove the old radioCopyVal spans (to be replaced with new ones)
              $("input[name=woots]:radio").each(function() { //for each radio button in name woots
                  if ($(this).attr("checked")) { //if the button is checked, add a span saying 'Checked.' after it. css is used to hide the span
                      $(this).after('<span class="radioCopyVal">Checked.</span>');
              }else {
                  $(this).after('<span class="radioCopyVal">Not checked.</span>');
              }
              })
          });
        </script>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple html table element. <table border=2 cellpadding=5 cellspacing=0 width=40%> <tr><td> aaa
I have a html element (like select box input field) in a table. Now
I have an HTML table in my jsp page. This conains text fields and
I have an HTML table that contains some 500 rows. I have an input
I have a table in HTML with a few rows. I originally gave some
I have a list of items (which are HTML table rows, extracted with Beautiful
I have some html element like these: <table id=myTable></table> <select name=mySelect> <option value=1>1</option> <option
I have a table with an HTML attribute on the TR element titled data-order
I am trying to insert rows into an html table with javascript. I have
I have a table of rows and columns on an HTML-based entry form that

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.