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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:46:31+00:00 2026-05-29T09:46:31+00:00

Following is my code: <table border=0 align=center cellpadding=0 cellspacing=0 class=grid_table> <tr class=grid_caption><td class=grid_caption>Customer Name</td></tr>

  • 0

Following is my code:

<table border="0" align="center" cellpadding="0" cellspacing="0" class="grid_table">
    <tr class="grid_caption"><td class="grid_caption">Customer Name</td></tr>
    <? if(count($arrResult) > 0) { ?>
        <? foreach($arrResult as $row) { ?>
        <tr class="grid_row"  ><td class="grid_row" onClick="javascript:return selectCustomer(this,<?=$row['customer_id']?>);"><?=HTMLVarConv($row['Name'])?></td></tr>
        <? } ?>
    <? } ?>
</table>

here i got the list of customer
but when i click on this customer name then its background color should be change..
here is my javascript function

function selectCustomer(row, id) {
    alert(row);
    var mark_color = '#fdf5d2' //'#c1c1ff'
    var current_row = '#aad4f0' //'#e8e8e8'
    if (row.style.backgroundColor == current_row) {
        row.style.backgroundColor = mark_color;
    }
    else if (row.style.backgroundColor == mark_color) {
        row.style.backgroundColor = current_row;
    }
    $("#editCustomer").attr("src","editcustomer.php?customer_id="+id+"&showmenu=0");
    $("#ajaxList").show();
    return;
}

but not changing what the problem ????
please help me

  • 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-29T09:46:32+00:00Added an answer on May 29, 2026 at 9:46 am

    This one is perfect well:
    Css::

    .grid_row
    {
        padding: 3px;
        border-right: 1px solid #849AAA;
        border-bottom: 1px solid #849AAA;
        vertical-align:top;
    }
    .evn
    {
        padding: 3px;
        border-right: 1px solid #849AAA;
        border-bottom: 1px solid #849AAA;
        vertical-align:top;
        background-color: white;
        /*document.body.style.cursor = 'wait';*/
        cursor: pointer;
        }
    .selevn
    {
        padding: 3px;
        border-right: 1px solid #849AAA;
        border-bottom: 1px solid #849AAA;
        vertical-align:top;
        background-color: silver;
        cursor: pointer;
    }
    

    Following is my Javascript code:-

    <script type="text/javascript">
    var prevRow = null;
    function selectCustomer(it,id) {
        if (it.className.substring(0, 3) == "sel")
        {
            it.className = it.className.substring(3, 6);
            prevRow = null;
        }
      else
        {
            it.className = "sel" + it.className;
            if (prevRow != null)
            {
               prevRow.className = prevRow.className.substring(3, 6);
            }
            prevRow = it;
        }
        $("#editCustomer").attr("src","editcustomer.php?customer_id="+id+"&showmenu=0");
        $("#ajaxList").show();
        return ;
    }
    

    THis is my code:

    <table border="0" align="center" cellpadding="0" cellspacing="0" class="grid_table">
            <tr class="grid_caption"><td class="grid_caption">Customer Name</td></tr>
            <? if(count($arrResult) > 0) { ?>
            <? foreach($arrResult as $row) { ?>
            <tr class="evn"  onClick="javascript:return selectCustomer(this,<?=$row['customer_id']?>);" ><td class="grid_row" id="<?= $row['customer_id']?>"  ><?=HTMLVarConv($row['Name'])?></td></tr>
            <? } ?>
            <? } ?>
            </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: HTML <table width=30% border=0> <tr> <td colspan=4 align=center> <asp:Label
Consider the following code: @Entity @Table(name = a) public class A implements Serializable {
I have a table layout with the following code <table cellspacing=0 class=photogalleryTable> <tbody> <tr>
I have the following code <table cellpadding=2 cellspacing=2> <tr> <td>Factory:</td> <td> <asp:TextBox ID=txtFactory runat=server
Given the following code, how do I left align the table without using float:left
I'm reading about sqlalchemy and I saw following code: employees_table = Table('employees', metadata, Column('employee_id',
I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
I have the following code: $sql = INSERT INTO table VALUES ('', ...); $result
I have the following code: ListBox.DataSource = DataSet.Tables(table_name).Select(some_criteria = match) ListBox.DisplayMember = name The
I have the following code, I'm trying to get a table with 4 columns

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.