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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:22:43+00:00 2026-05-28T18:22:43+00:00

<table id=ratecardlist> <tr> <th> Show Time</th> <th> Balcony </th> <th> Box </th> <th> &nbsp;

  • 0
<table id="ratecardlist">
    <tr>
        <th> Show Time</th>
        <th> Balcony </th>
        <th> Box </th>
        <th> &nbsp; </th>
    </tr>
   <tr>
       <td>10.30AM</td>           
       <td><input type="text" name="bal:1:3" value="100" /> </td>
       <td><input type="text" name="box:1:5" value="200" /> </td>
       <td><a href="#" onClick="applytoAll();">Apply To All</a></td>
   </tr>
   <tr>
       <td>1.30PM</td>           
       <td><input type="text" name="bal:3:3" value="400" /> </td>
       <td><input type="text" name="box:3:5" value="450"/> </td>
       <td>&nbsp;</td>
   </tr>
  <tr>
       <td>6.30PM</td>           
       <td><input type="text" name="bal:5:3" value="600" /> </td>
       <td><input type="text" name="box:5:5" value="600" /> </td>
       <td>&nbsp;</td>
   </tr>
       .
       .
       .
</table>

Apply to All link will always in second row. When I Click Apply To All, input values in this row should copy to other rows input fields. How to do that plz Help.

e.g.
After click Apply To All,

   <table id="ratecardlist">
    <tr>
        <th> Show Time</th>
        <th> Balcony </th>
        <th> Box </th>
    </tr>
   <tr>
       <td>10.30AM</td>           
       <td><input type="text" name="bal:1:3" value="100" /> </td>
       <td><input type="text" name="box:1:5" value="200" /> </td>
       <td><a href="#" onClick="applytoAll();">Apply To All</a></td>
   </tr>
   <tr>
       <td>1.30PM</td>           
       <td><input type="text" name="bal:3:3" value="100" /> </td>
       <td><input type="text" name="box:3:5" value="200"/> </td>
       <td>&nbsp;</td>
   </tr>
  <tr>
       <td>6.30PM</td>           
       <td><input type="text" name="bal:5:3" value="100" /> </td>
       <td><input type="text" name="box:5:5" value="200" /> </td>
       <td>&nbsp;</td>
   </tr>
       .
       .
       .
</table>
  • 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-28T18:22:44+00:00Added an answer on May 28, 2026 at 6:22 pm

    First, the way you’re handling the click event does not provide enough context (e.g. the clicked element) to the handler. Ideally, you would decorate your link with an id or a class attribute and use that to register the handler unobtrusively (through jQuery’s click() method, for instance).

    If you’re stuck with your current strategy, you should at least pass the clicked element to the handler:

    <a href="#" onClick="applyToAll(this);">Apply To All</a>
    

    From there, you can implement the function as follows:

    function applyToAll(element)
    {
        // Build an array with the values of this row, in document order.
        var $row = $(element).closest("tr");
        var values = $row.find("input:text").map(function() {
            return $(this).val();
        }).get();
    
        // Apply the values to the other rows.
        $row.nextAll().each(function() {
            $(this).find("input:text").each(function(index) {
                $(this).val(values[index]);
            });
        });
    }
    

    This solution supports an arbitrary number of input elements per row, not just two.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Table: Unit ID NAME VALUE 1 Kilo 1000 2 Mega 1000000 3 Giga 1000000000
Table locations contains locID , lat & long & name values of a certain
Table - user_feed column name - date_n_time (type - datetime) How do I write
Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date)
table { id: long name: string } 1235 Fred 1902 Trever 5123 George 6467
table user: |id|name|employee_priority_id|user_priority_id| table priority: |id|name| As you can see, there are two foreign
table 1(ob): name,address table 2(address): dname,addr I need to update ob.address with address.addr when
TABLE tab sl_no name marks status 1 dude 33 y 2 dudz 38 y
Table Layout: TABLE ORDER: id localizedInfoId Table OrderLocalizedInfo: id localizedInfoId name With the following
Table Schema Table Name: file_manager_folder Rows: id , parentId , name My query simulates

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.