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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:53:06+00:00 2026-05-25T00:53:06+00:00

I have a dropdown selection box with the following: <select name=type id=speedB style=width:324px;> <option

  • 0

I have a dropdown selection box with the following:

<select name="type" id="speedB" style="width:324px;">
    <option value="">Please Select</option>
    <option value="9.99">1 = $9.99</option>
    <option value="19.99">5 = $19.99</option>
    <option value="39.99">10 = $39.99</option>                          
    <option value="199.99">All = $199.99</option>
</select>

Basically, what I want to do is:

If value 9.99 is chosen, display 1 input box for them to enter
something in to.

If value 19.99 is chosen, display 5 input boxes for them to enter
something in to.

If value 39.99 is chosen, display 10 input boxes for them to enter
something in to.

If value 199.99 is chosen, display ONE input box with the
name="state" for them to enter something in to.

I want the newly created input boxes to have a name such as name="pc1" name="pc2" etc.. unless value 199.99 is chosen, I only want one input box to be shown with the name="state"

How would I go about doing this?

  • 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-25T00:53:07+00:00Added an answer on May 25, 2026 at 12:53 am

    Add a container for the input boxes on the page with say id “inputboxes” and try this.

    Working demo

    $(function(){
        $("#speedB").change(function(){
            var $inputboxes = $("#inputboxes").html(''), inpCount = 0;
            if(this.value == "9.99"){
                inpCount = 1;
            }
            else if(this.value == "19.99"){
                inpCount = 5;
            }
            else if(this.value == "39.99"){
                inpCount = 10;
            }
            else if(this.value == "199.99"){
                inpCount = "ALL";
            }
           for(var i = 0;i<inpCount;i++){
               $inputboxes.append("<input type='text' name='pc"+(i+1)+"' /><br />");
           }
            if(inpCount == "ALL"){
                $inputboxes.append("State: <input type='text' name='pc1' />");
            }
        }); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following dropdown list box: <select name=DDLConditional1 size=1> <option selected=selected>is equal to</option>
I have the following dropdown box <form name=myform method=POST ACTION=songs.php> Select Category: <select id=sel
The following code produces a dynamic dropdown box. <select name=parent> <?php $q = $admindb->getParentCategories();
I have a dropdown list that stores name/value pairs. The dropdown appears in each
I have the following HTML containing a drop down list (single selection) <script type="text/javascript">
I have the following HTML dropdown box on the index view of the Search
I have a dropdown box (Combobox). Everytime I make a new selection a table
I have the following in a config.ini file: (Zend_Form_Element) site_status.name = site_status site_status.type =
I have dropdown menu..which is dynamic.. How can get value of the last item
I have a dropdown box and a literal tag inside an Update Panel. On

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.