Ad block is installed and active. Please support us by disabling it.
HomeSaturday, October 21, 2017, 10:36:06
4

How to check checkbox checked

Wednesday, February 18, 15, 17:43:45, 3 Yaers Ago Via cilipe, Hits: 3341
Checking if checkbox is checked with jQuery
Code:
<form>
<input type="checkbox" name="mycheckbox" id="fieldid" value="1" /> One<br>
<input type="submit" id="query" name="query" value="query" />
</form>
<div id="echo"></div>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$("form").submit(function(event) {
if($('#fieldid:checked').size() == '') {
$("#echo").text("Not Checked" ).show();
event.preventDefault();
return false;
}
$("#echo").text("Checked!").show();
return;
});
</script>

Sign In

Sponsor

Related

Smarty Paginate Example - Smarty Pagination with PHP

Smarty Paginate Example, Smarty Pagination with PHP. SmartyPaginate: a class/plugin for data set pagination within the Smarty template environment

MySQL – Select from two tables

Select data from two tables, PHP MySQL

Contact Us PHP Form 1.1.

A contact us form with email and form field validation. It allows your visitors to send you an email directly from your website.

Password Protect With PHP

Password protect tith PHP - tutorial

PHP Redirect

Header (location) redirect must be processed before any output to the browser.

PHP Form Basic

PHP Form - PHP form basic, Requirement(s): PHP Server

Bookmark Current Page - PHP Tutorial

Bookmark current page with PHP example.

MySQL Tutorials

MySQL tutorials, MySQL training, learn MySQL, MySQL Tutorial with practical examples.

PHP Jquery Form

PHP Jquery Form allow your visitors to contact you directly from your website.

MySQL Inner Join

MySQL Inner Join - Creating Dynamic Webpages Using PHP and MySQL, Requirement(s): PHP Server, MySQL
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.