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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:27:20+00:00 2026-06-12T02:27:20+00:00

I am working on a program for my company to process different product types

  • 0

I am working on a program for my company to process different product types and create files.

I have a form that will eventually grow to close to 150 checkbox options over the course of a few months. I’m trying to get input on the best way to do this and save me time in the long run.

So for example I have this:

<input type="checkbox" value="NOT" name="size">NOT<br />
<input type="checkbox" value="THA" name="size">THA<br />
<input type="checkbox" value="TAB22" name="size">TAB22<br />

What I need is that for every checkbox that is clicked, i need to reveal a text area w/ a simple title that is equal to the checkbox value above it within a div called <div id="inputArea"> From here the user will then paste in file names in the corresponding text areas. Basically each text area is tied to a checkbox option.

I use PHP to process the form, so when it is submitted, at that point I will need to store the value of each text area that has values into separate variables. Is there a way to do that dynamically as well?

I’m open to jquery, javascript, php or anything.

I’m just curious as the best to do this. Otherwise my knowledge is only good enough to manually create 150 checkboxes, then create 150 text areas, then create 150 jQuery hide/reveal methods, then create 150 php checks to determine what text areas have values and assign them to variables.

  • 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-12T02:27:21+00:00Added an answer on June 12, 2026 at 2:27 am

    You may try this

    HTML

    <form action="some_action.php" method="post">
        <input type="checkbox" value="NOT" name="size">NOT<br />
        <input type="checkbox" value="THA" name="size">THA<br />
        <input type="checkbox" value="TAB22" name="size">TAB22<br />
        .... 
    </form>
    

    JS

    $('input:checkbox[name="size"]').on('click', function(){
        if($(this).is(':checked'))
        {
            $('<div class="inputArea"></div>') // inputArea is a class not an ID because ID should be anique
            .append($('<textarea />', {id:'txtArea_'+$(this).val(), name:'txtArea_'+$(this).val()}))
            .insertAfter($(this).next('br'));
        }
        else
        {
            $(this).next('br').next('div.inputArea').remove();
        }
    });
    

    DEMO.

    Every textarea has name and id with prefix txtArea_ with value of it’s corresponding checkbox so if a checkbox is submitted and it’s value is NOT then you can retrive the value of that corresponding textarea in php as

    $txtArea_NOT=$_POST['txtArea_NOT']; // When form's method is post
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an installation program for one of my company's product. The
I have a working program in C++ that generates data for a Mandelbrot Set.
I am currently working on a Javascript program for my company (Leader Technologies) that
I am working for a company and I need to create a program really
I have apple developer program for my company and have been working on for
I have a program that I'm writing where I am using another company's library
I'm working on a site for company that is already using a program for
I have a working C program where the length of an array of strings
I'm trying to get a simple winsock program working, so I create my socket
I am working on a little file copying program for my company and it's

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.