Ad block is installed and active. Please support us by disabling it.
HomeSunday, August 20, 2017, 22:49:09
4

How to check checkbox checked

Wednesday, February 18, 15, 17:43:45, 3 Yaers Ago Via cilipe, Hits: 3003
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

PHP Form Basic

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

PHP explode

Explode — Split a string by string.

Creating a basic bad word filter in PHP

This tutorial will show you how to create a basic bad word filter in PHP

PHP $_GET Function

Get function in PHP

Upload Image With PHP

[Example3] Tutorial - How to upload image in php.

PHP File Create

Create and write data to a file using the php frwite function.

Smarty - Create dynamic Web Pages with PHP & MySQL

Creating Dynamic Web Pages Using Smarty and MySQL - Requirement(s): PHP Server, MySQL

Timed Redirect JavaScript

Timed redirect javaScript/PHP example

Bookmark Script

Allow your users to easily bookmark your site, by clicking on a link on the page.
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.