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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:17:19+00:00 2026-05-16T10:17:19+00:00

<form> <input type=checkbox id=m_q name=m_q value=271>Name</input><div name=status></div> <input type=checkbox id=m_q name=m_q value=271>Age</input><div name=status></div> <input

  • 0
     <form>
  <input type="checkbox" id="m_q" name="m_q" value="271">Name</input><div name="status"></div>
   <input type="checkbox" id="m_q" name="m_q" value="271">Age</input><div name="status"></div>
   <input type="checkbox" id="m_q" name="m_q" value="271">ID</input><div name="status"></div>
  <input type="checkbox" id="m_q" name="m_q" value="271">Emp no</input><div name="status"></div>
 <input type="button" value="save" onclick="save" />
 </form>

 <script>
   function save()
    {
     $.post("/det/save_details/",snddata,
    function(data){
   if(data == 0 ){
   alert('data added');
   //How to disable the checkbox field and in the div say data added
    },"json");
     } 
</script>

In the above code after getting the response from the server onselect() ,how to say “data added” in the status div for selected checkbox only

  • 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-16T10:17:20+00:00Added an answer on May 16, 2026 at 10:17 am

    @Haim’s code works but I think he was asking how to add the html to the div based on which checkbox was checked and based on the html he provided, which doesn’t have specific ID’s for the divs, so here is some jquery code that works with the html you have provided. It grabs the checked boxes and disables them, then grabs the next sibling div with name=status to add the html text to it.

    $('input:checkbox:checked').attr('disabled', true);
    $('input:checkbox:checked + div[name=status]').html('data added');
    

    You can see a jsFiddle page with an example with your HTML (without the Ajax part and just done in the click event of the button instead).

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

Sidebar

Related Questions

foreach($apps as $app){ echo $this->Form->input('Application', array('type'=>'checkbox', 'id'=>$app['Application']['description'], 'div'=>false,'type'=>'checkbox','value' => $app['Application']['description'],'label'=>$app['Application']['description'])); } <div class=checkboxes> <input
<form name=author-form accept-charset=utf-8 method=post> <input type=checkbox id=checklist-1 name=checklist[] value=0 required /></td> <label for=checklist-1>The submission
I have this form: <input type=checkbox value=First />First <input type=checkbox value=Second />Second <input type=checkbox
<form method=POST> <input type=checkbox id=hrm name=hrm /> </form> I mean when the form is
I have a HTML form containing checkboxes in the form of .. <input type=checkbox
HTML has an input button type to reset all fields in a form to
I'm using labels for my form, like this : <label for=foo id=bar>Label</label> <input type=checkbox
I'm generating an html file which looks like: <tr id=ID001 property1=PROPERTY001><td><input type=checkbox name=row_checkbox_ID001></td><td>...</td><td>...</td></tr> <tr
I'm using Zend_Form to output a set group of checkboxes: <label style=white-space: nowrap;><input type=checkbox
I have in my form an input element with type of file. What I

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.