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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:21:05+00:00 2026-06-10T05:21:05+00:00

I have a table In the table first column displays a checkbox and second

  • 0

I have a table
In the table first column displays a checkbox and second has a textbox.
Now i want onclick of a checkbox a datepicker should be enabled in the textbox of that specific row. and this should happen onclick of every checkbox in each row.

Here is wat i have tried:

//Inside View:

@foreach (var item in Model.Select((x, i) => new { Data = x, Index = i + 1 }))
    {
  <div class="cell"> <input type="checkbox" name="chkbox" class="a"  onclick="checkbox1()" data-id="@item.ID" />
        </div>
 <div class="cell" id="edit2">@Html.DisplayFor(modelItem => item.ExhibEndDate)</div>
 <div class="cell" id="edit1">@Html.TextBox("Enddate", item.ExhibEndDate) </div>

//Javascript Code:

function checkbox1() {

    if ($('.a').is(':checked')) {
        $(this).document.getElementById('edit1').style.display = 'block';
        $(this).document.getElementById('edit2').style.display = 'none';           
    }
}

Here i tried hiding and displaying tags but with this onclick of a checkbox in any row datepicker is enabled only in the textbox of first row.

Please help me i m really not able to figure this out.

  • 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-10T05:21:07+00:00Added an answer on June 10, 2026 at 5:21 am
    @foreach (var item in Model.Select((x, i) => new { Data = x, Index = i + 1 }))
        {
      <div class="cell"> <input type="checkbox" onclick="checkbox(@item.Index)" />
            </div>
     <div class="cell" id="edit-@item.Index">@Html.TextBox("Enddate", item.ExhibEndDate) </div>
    

    JS:

    function checkbox(index){
         $(this).document.getElementById('edit-' + index).style.display = 'none';
    }
    

    Something like this. I hope you’ve got the point

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

Sidebar

Related Questions

I have two table first is TABLE_SUBJECT and second is TABLE_CHAPTER.Now i want to
What I want is to have a table having a first column with every
I have a simple table. The first column has max-width set at 15px. It
I have two tables. The first table has a column with a lot of
I have a HTML table that displays rows of records and has a column
I have a HTML table where each row has two columns. First column is
Suppose I have a table, the first column is an identity. I thought that
I have a table with 4 columns. The first column is unique for each
I have a table inside a form. It has two columns, the first one
I have created a table in Visual Studio. That table has two columns. First

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.