Click here to Skip to main content
15,891,607 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: How to Commnuicate with .net to javaServlat Pin
Abhishek Sur30-Oct-09 9:41
professionalAbhishek Sur30-Oct-09 9:41 
GeneralRe: How to Commnuicate with .net to javaServlat Pin
Oakman3-Nov-09 12:12
Oakman3-Nov-09 12:12 
QuestionWhether API can be used in Javascript Pin
sanuji29-Oct-09 17:51
sanuji29-Oct-09 17:51 
AnswerRe: Whether API can be used in Javascript Pin
Christian Graus29-Oct-09 19:00
protectorChristian Graus29-Oct-09 19:00 
GeneralRe: Whether API can be used in Javascript Pin
sanuji29-Oct-09 22:55
sanuji29-Oct-09 22:55 
GeneralRe: Whether API can be used in Javascript Pin
Covean30-Oct-09 1:59
Covean30-Oct-09 1:59 
QuestionCheck all doesn't work with one row in javascript Pin
condemnity28-Oct-09 17:59
condemnity28-Oct-09 17:59 
AnswerRe: Check all doesn't work with one row in javascript Pin
enhzflep29-Oct-09 2:23
enhzflep29-Oct-09 2:23 
Hehe hehe.

Cool. Didn't know that before - that's a neat thing you've just taught me.



When there is only one check-box, "document.myform.list" points to a checkbox item. When there's more than one, it points to an _array of_ checkbox items. Since ".length" is for use on arrays, it fails and returns "undefined" when called on an any var that's not an array.

Simply put, all you have to do is check the return value of "field.length". If it doesn't have one, then you're dealing with a single item. Otherwise, you're dealing with an array of items.

Here, try this on for size:
function checkAll(field)
{
	if (!field.length)
		field.checked = true;
	else
		for (i = 0; i < field.length; i++)
			field[i].checked = true ;
}

function uncheckAll(field)
{
	if (!field.length)
		field.checked = false;
	else
		for (i = 0; i < field.length; i++)
			field[i].checked = false;
}

GeneralRe: Check all doesn't work with one row in javascript Pin
condemnity29-Oct-09 4:22
condemnity29-Oct-09 4:22 
GeneralRe: Check all doesn't work with one row in javascript Pin
enhzflep29-Oct-09 9:00
enhzflep29-Oct-09 9:00 
GeneralRe: Check all doesn't work with one row in javascript [modified] Pin
boopathiduraisamy30-Oct-09 2:10
boopathiduraisamy30-Oct-09 2:10 
GeneralRe: Check all doesn't work with one row in javascript Pin
enhzflep30-Oct-09 2:28
enhzflep30-Oct-09 2:28 
QuestionEnabling Default Document Pin
www.Developerof.NET28-Oct-09 9:17
www.Developerof.NET28-Oct-09 9:17 
AnswerRe: Enabling Default Document Pin
Marc Firth28-Oct-09 23:09
Marc Firth28-Oct-09 23:09 
QuestionCrystal Reports Export to PDF not working Pin
Tamimi - Code28-Oct-09 8:07
Tamimi - Code28-Oct-09 8:07 
QuestionRe: Crystal Reports Export to PDF not working Pin
Jörgen Andersson29-Oct-09 1:49
professionalJörgen Andersson29-Oct-09 1:49 
AnswerRe: Crystal Reports Export to PDF not working Pin
Tamimi - Code30-Oct-09 0:49
Tamimi - Code30-Oct-09 0:49 
GeneralRe: Crystal Reports Export to PDF not working Pin
Jörgen Andersson30-Oct-09 1:09
professionalJörgen Andersson30-Oct-09 1:09 
GeneralRe: Crystal Reports Export to PDF not working Pin
Tamimi - Code30-Oct-09 3:57
Tamimi - Code30-Oct-09 3:57 
GeneralRe: Crystal Reports Export to PDF not working Pin
N.Surendra Prasad12-Nov-09 0:34
N.Surendra Prasad12-Nov-09 0:34 
QuestionASP(Tinymceeditor) Pin
rajiv_kadam28-Oct-09 1:03
rajiv_kadam28-Oct-09 1:03 
AnswerRe: ASP(Tinymceeditor) Pin
Ashfield29-Oct-09 2:57
Ashfield29-Oct-09 2:57 
QuestionOnly 1st page of wikipedia gets printed Pin
Sharadb.adobe27-Oct-09 23:48
Sharadb.adobe27-Oct-09 23:48 
QuestionWhat is the common Calendar synchronization principle? Pin
Pradeep kumar.V27-Oct-09 22:15
Pradeep kumar.V27-Oct-09 22:15 
QuestionProblem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
chirag_chauhan27-Oct-09 15:25
chirag_chauhan27-Oct-09 15:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.