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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:00:37+00:00 2026-06-10T04:00:37+00:00

I am trying to replace password textboxes with regular textboxes once the password has

  • 0

I am trying to replace password textboxes with regular textboxes once the password has been entered. This code works only if the very first password textbox is not empty but then it also performs the code on every password textbox.

if ($('input[type=password]').val() != "") {
                    $('input[type=password]').hide(); 
                    $('input[class=showPswd]').show(); 
                }

I thought something like this would work but it is not.

if ($('input[type=password]').val() != "") {
                        $(this).find('input[type=password]').hide(); 
                        $(this).find('input[class=showPswd]').show(); 
                    }

How do I get the code to look at each password textbox and replace only that textbox when it is empty?

Thanks

EDIT: This is the general layout. There are more rows that are almost identical.

                <td class="style1">
                    QA :</td>
                <td class="style2">
                <asp:DropDownList ID="DropDownList4" runat="server">                   
                    </asp:DropDownList>
                    </td>

                <td style="vertical-align:middle">
                    <asp:TextBox ID="TextBox4" runat="server" textmode="Password"></asp:TextBox>
                        <asp:TextBox ID="TextBox21" runat="server" style="display:none;" class="showPswd" value="Accepted"></asp:TextBox>

                    <asp:Label ID="Label4" runat="server" Text=""
                    ></asp:Label>
                    </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-06-10T04:00:38+00:00Added an answer on June 10, 2026 at 4:00 am

    make use of each() function , to do the operation on each textbox having type password like as below

        $('input[type=password]').each(
        function ()
        {
        if ($(this).val() != "")  
         { 
                  $(this).hide(); 
    
                  //just replace this line as you need not sure what is does 
                  //$(this).find('input[class=showPswd]').show();
         } 
    
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a regular expression in C# that will replace the password
Trying to replace this jquery code with some php server side magic: $(document).ready(function() {
I have been trying to replace a word in a text file with a
So I have this code, which I am trying to use to make it
Hello everybody I'm trying to replace the 'text' input type to 'password' . And
Trying to add carrier wave based image uploading to my user model. This works
im trying to replace the default 'Required' message in this validator: $this->setValidator('email', new sfValidatorAnd(array(
Trying to replace any non alpha-numeric characters with a hyphen. Can't see why it
I'm trying to replace the top-level navigation of my site with images instead of
I'm trying to replace the zoom functionality with scroll on my microsoft ergonomic keyboard

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.