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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:29:01+00:00 2026-05-25T18:29:01+00:00

I have a table with rows of 2 input text boxes in each row:

  • 0

I have a table with rows of 2 input text boxes in each row:

<table>
    <tr><td><input id="1_1" type="text"></td><td><input id="1_2" type="text"></td></tr>
    <tr><td><input id="2_1" type="text"></td><td><input id="2_2" type="text"></td></tr>
    <tr><td><input id="3_1" type="text"></td><td><input id="3_2" type="text"></td></tr>
</table>

If the user has just one of the input texts filled in, I would like to append a certain icon in front of the row. If the user has both inputs filled in, I would like to append a different type of icon. All of this occurs on a per row basis. How would I go about accomplishing this?

Any suggestions would be greatly appreciated.

  • 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-25T18:29:02+00:00Added an answer on May 25, 2026 at 6:29 pm

    Have you tried anything? Seems like some pretty straightforward jQuery to me.

    Here’s a working example where I’ve added an additional <td> prior to the input fields and inserted a <div class="icon"></div> inside of it as a placeholder for the icon you want.

    The jQuery for changing it is the following:

    $(function(){
        $('input').keyup(function(){
            var row = $(this).parent().parent();
            var inputsChanged = 0;
            row.find('input').each(function(){
                if($(this).val() !== '') inputsChanged++;
            });
            if(inputsChanged === 1){
                row.find('.icon').css('background-color','red');
            }else if(inputsChanged === 2){
                row.find('.icon').css('background-color','green');
            }else if(inputsChanged === 0){
                row.find('.icon').css('background','none');
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table where I can generate dynamic rows (which has input <type=text
I have a table with multiple rows. Each row is a form. I want
I have a table with multiple rows in each row is a select list
I have table in wordpress admin panel: <tr> <td><input style=width:80% type=text name=ism value= /></td>
I have the following: <table> <tr><td>author's first name</td><td>author's last name</td></tr> <tr><td><input type='text' name='first_name' /></td><td><input
I have a table that contains multiple rows. Each row contains 5 columns (or
I have an input text box and an html table with rows of text.
I have html table with 3 rows each row contains two <td> one with
Suppose table 1 Have 1,000,000 rows. In table 2 there are 50,000 rows INPUT
how remove html table rows after 2nd row? if in table have 5 row,

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.