Ad block is installed and active. Please support us by disabling it.
HomeTuesday, February 20, 2018, 01:34:50
4

How to check checkbox checked

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

Advanced Contact Form - PHP Script

Advanced Contact Form with email and form field validation. Features: HTML Output(Response), Captcha Image.

PHP $_POST Function

Collect values from a form sent with method post

Captcha V2 - Free PHP Script

PHP Captcha protection image Version 2, - Requirement(s): PHP Server, GD Library

PHP imagecreate

imagecreate() returns an image identifier representing a blank image of specified size.

Jquery PHP Contact Form

This script allows your visitors to send you an email directly from your website.

Prevent the error loading XML – libxml_use_internal_errors

libxml_use_internal_errors() allows you to disable standard libxml errors and enable user error handling.

PHP str_replace

str_replace - This function returns a string or an array with all occurrences of search in subject replaced with the given replace value

Preg_Match - PHP Email Validation

Validate email with preg_match in php

PHP Date Examples

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given.

FeedBack Form with Captcha

It allows your visitors to send you an email directly from your website.
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Mon, Jan 29, 18
So far has created 115 entries.
wain
This author has not yet filled in any details.