javascript - How I can disable page redirect when click on checkbox? -


i have code:

<div onclick="$(location).attr('href','updateuser.php?id=<?php echo $admin->id; ?>')" class="dbitem">                 <div class="dbitemcheckbox">                   <input name="se8" type="checkbox" value="<?php echo $admin->id; ?>" />                 </div>                 <div class="dbitemmessageiconadmin"><img src="images/admin.png" alt="" width="20" height="23" border="0" /></div>                 <div class="dpitemname"><?php echo $admin->username; ?></div>                 <div class="dpitemtitle"><?php echo $te; ?></div>                 <div style="left: 110px" class="dpitemdate"><?php echo $admin->registerdate; ?></div>                 <div class="dpitemdelete"><a href="editusers.php?del=<?php echo $admin->id; ?>"><img src="images/delete.png" alt="" width="11" height="10" border="0" /></a></div>               </div> 

when user click on div, browser go update page.

the problem facing when user clicks checkbox check multi delete go update page.

how can disable when user click on checkbox.

prevent bubbling of event on checkbox. try this:

$(".dbitem input[type='checkbox']").click(function(evt) {     evt.stoppropagation(); }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -