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

  • Home
  • SEARCH
  • 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 7429661
In Process

The Archive Base Latest Questions

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

i’am working on checkboxes when user click checkbox i am checking is it checked

  • 0

i’am working on checkboxes when user click checkbox i am checking is it checked or not if checked i update value on database here is my code

$(document).ready(function(){
    $('input[type="checkbox"]').bind('click',function() 
    {
         var tObj = $(this).val();
         if ($('#checkpermission').is(':checked'))
         {
            alert(tObj);
            $.ajax({
                  url: 'checkpermission.php',
                  data: {"Selected":tObj},
                  type: 'post',
                  success:function(data)
                  {
                     alert(data);
                     //Succes!
                  }
            });
         }
         else
         {
             // alert(tObj);
             $.ajax({
                   url: 'uncheckpermission.php',
                   data: {"Selected":tObj},
                   type: 'post',
                   success:function(data)
                   {
                      alert(data);
                      //Succes!
                   }
             });
         }
    });

});


   <?php
session_start();
require 'dbconnect.php';
$page_name="RegisterUsers.php";
$start=$_GET['start'];
if(strlen($start) > 0 and !is_numeric($start))
{
echo "Data Error";
exit;
}
$eu = ($start - 0);
$limit = 8;
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;



$query="select * from tbl_user where username!='admin' and password!='admin'";
$result=mysql_query($query);
$nume=mysql_num_rows($result);
if($nume>0)
{


if($_REQUEST['SearchText'])
{

$find=$_REQUEST['SearchText'];
$query="select * from tbl_user where username!='admin' and password!='admin' and username LIKE'%$find%' or Email LIKE'%$find%' or PhoneNumber LIKE'%$find%' order by id limit  $eu, $limit";
}
else
{
$query="select * from tbl_user where username!='admin' and password!='admin' order by username limit  $eu, $limit";
}
$result=mysql_query($query);
while($data=mysql_fetch_row($result))
{
 if($data[5])
 {
 $path=$redirect."/services/User/".$data[5];
 }
 else
 {
 $path=$redirect."/images/noimage.png";
 }
?>
 <tr>
<td class="gallery">

<a href='<?=$path ?>'>
 <img width="50" height="50" src=<?php echo $path; ?> />
 </a>

</td>
<!--<td id='myText'><img width=50 height=50 src=<?php echo $path; ?> /></a></td>-->
 <td><?=$data[1]?></td> 
 <td><?=$data[3]?></td>
 <td><?=$data[4]?></td>
 <td>
 <div style="padding-left:25px;">
 <INPUT TYPE="checkbox" class="checkpermission" name="checkuser" id="checkpermission" value='<?=$data[0]?>'<?php if($data[6]=="Read-Write"){echo "checked";}?>>
 </div>
 <div>
 Read-Write
 </div>
 </td>

<td class='delete'><a  href='http://ifliptips.com/admin/VueGuides/AddUser.php?id=<?=$data[0]?>&action=edit' >Edit</a></td>
 <td class='delete'><a href='http://ifliptips.com/admin/VueGuides/RegisterUsers.php?id=<?=$data[0]?>&action=delete' onClick="return deletepressed();">Delete</a></td>
 </tr>
<?php
}
}
?>

every time when user click goes on if condition only else loop not working i am seeing response

so can any one guide me how can i overcome this
Thanks for advance.

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

    Try to use

    if($("#checkpermission:checked").length > 0)
    

    Solution

    There were more than one check box with checkpermission. So the code needs to be modified like this

    $('input[type="checkbox"]').bind('click',function() 
    {
         var tObj = $(this).val();
         if ($(this).is(':checked'))
         {
             //Rest of the code
    

    Ajay will change the code to generate unique ids for the checkbox. Above code will work for this case too.

    Check this jsFiddle

    Hope this works for you.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.