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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:50:10+00:00 2026-05-24T05:50:10+00:00

The initial idea, is to hide an input element and show it based on

  • 0

The initial idea, is to hide an input element and show it based on a change event in a select element. However, the code I have is not hiding the input and so nothing happens with the change statement. Could someone check the code and show me my error. Thanks

<label for="AUSR_companyname">Company Name:</label>
<input id="AUSR_companyname" name="AUSR_companyname" type="text" class="text ui-widget-content ui-corner-all inputbox AUSR_companyname" value = "" />


!--- dropdown for new user addition  -->
<script language="javascript" type="text/javascript">
      $("#AUSR_companyname").hide();
            $(function() {
            jQuery("#AUSR_company").live('change', function() {
                  if($(this).val()=="new")
                 {
                    $("#AUSR_companyname").show(); 
                }
            });
      });
</script>
<!--- end of dropdown for new user addition -->

++++UPDATE++++

This script is now causing error ‘missing ) after argument list’. Where have I missed it? Thanks

$(function() {
    $("#AUSR_companyname, label[for=AUSR_companyname]").hide();
            jQuery('#AUSR_company").live('change', function() {
                  if($(this).val()=="new")
                 {
                    $("#AUSR_companyname").show(); 
                }
        });
      });
  • 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-24T05:50:11+00:00Added an answer on May 24, 2026 at 5:50 am

    It looks like you are using jQuery. Take care that you have included the jQuery-files in the html header section.

    After that, wrap your javascript code into the jQuery ready function:

    <script language="javascript" type="text/javascript">
       $(document).ready(function() {
          $("#AUSR_companyname").hide();
            $(function() {
            jQuery("#AUSR_company").live('change', function() {
                  if($(this).val()=="new")
                 {
                    $("#AUSR_companyname").show(); 
                }
            });
        });
      });
      </script>
    

    EDIT: to answer your question you posted in your comment block:
    To hide the label, too you could use something like this:

    $('label[for="AUSR_companyname"], #AUSR_companyname').hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Initial tests indicate that GDI+ (writing in VB.NET) is not fast enough for my
ModelMultipleChoiceField doesn't select initial choices and I can't make the following fix (link below)
We're in the initial stages of a large project, and have decided that some
Looking into developing new startup with potential of hopefully having high volume. Initial idea
We're building a PHP app based on Good old codeigniter framework and have run
I have built an event-base java html parser: Lagarto . Now I am working
I have this idea of developing an application (or a companion application to another
Desired effect I have a bunch of small images that I'd like to show
My initial question was here and was related to the postgres backend. Postgres subquery,
When prototyping initial GUI functionality with a customer is it better to use a

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.