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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:18:08+00:00 2026-05-26T11:18:08+00:00

I have a web form where I need to have an additional field displayed

  • 0

I have a web form where I need to have an additional field displayed on the screen if a certain option is selected in a drop down list. I have followed several Javascript tutorials online and none have worked so far. Here is one of the things I already tried:

    <script type="text/javascript">
    function setup(ans) {
      lit = ''
      if (ans == 'manual') {
        lit = 'Manual Selected'
        lit = lit + '<tr>'
        lit = lit + '<th align="right" class="body-text">Add New Group</th>'
        lit = lit + '<td class="body-text"><input type="text" name="groupadd">'
        lit = lit + '</td> </tr>'
     }
      document.getElementById('rep').innerHTML=lit
    }
    </script>

It doesn’t work. What else can I try?

I have also seen “http://stackoverflow.com/questions/7353403/javascript-hide-a-form-input-depending-on-the-value-of-a-particular-drop-down&#8221; but it does not work for me either.

Thanks!

And this is what I want to add:

    <tr>
        <th align="right" class="body-text">Add New Group</th>
        <td class="body-text"><input type="text" name="groupadd"></td>
    </tr>
  • 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-26T11:18:09+00:00Added an answer on May 26, 2026 at 11:18 am

    Try this.

      trElement = document.createElement('tr');
    
      thElement = document.createElement('th');
      thElement.className = "body-text";
      thElement.innerHTML = "Add New Group";
    
      trElement.appendChild(th);
    
      tdElement = document.createElement("td");
      tdElement.className = "body-text";
      inputElement = document.createElement("input");
      inputElement.type = "text";
      inputElement.name = "groupadd";
    
      tdElement.appendChild(inputElement);
      trElement.appendChild(tdElement);
    
      document.getElementById("new_field_div").appendChild(trElement);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web form that I am attempting to implement dynamic drop down
I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down
I have a web form setup on an area of my site. I need
I have a web form which has 23 textbox's , I need to pass
I have a Web content form and need to access a control inside the
Issue is resolved now... I have a simple web form where i need to
I need a field in a web form in rails named country that will
We have a couple mini-applications (single Web form look-up stuff) that need to run
I am running a thread in C#. I have web form. I declared public
I have a web form that binds a DataGrid to a, normally, different data

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.