[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

Check all checkboxes not working

The below function is called by clicking on another checkbox.
<!-- Begin
function SelAll(){
if (!isChecked(document.formPageEditor["Chk_IncYr"]))
		for (i = 0; i < field.length; i++)
		field[i].checked = true ;
	for (i = 0; i < field.length; i++)
		field[i].checked = false ;
//  End -->

Open in new window


The checkboxes are like this.

<input name="Chk_IncYr" type="checkbox" id="Chk_IncYr1" value="1" />
<input name="Chk_IncYr" type="checkbox" id="Chk_IncYr2" value="2" />

They are dynamically created. The form is called 'formPageEditor'.

The error is get is:

SCRIPT5007: El valor de la propiedad 'isChecked' es nulo o no está definido, no es un objeto de función
statement.asp, Línea 114 Carácter 1

Any ideas??
Abiel de Groot
Abiel de Groot
1 Solution
Do you have a function called isChecked in your code anywhere?  This is looking for another function to see if your box is checked, and isn't finding that function.

function isChecked (elementID) {
 return (document.getElementById(elementID).checked)

Open in new window

Should do the trick
Abiel de GrootAuthor Commented:
Many thanks ... ;-)

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now