[Javascript] RES: Javascript Digest, Vol 11, Issue 4

Luciano Fernandes da Silva Luciano.Silva at tco.net.br
Tue Jan 13 11:46:39 CST 2004


Before all, sorry my very very bad english!
Unfortunately, I don´t get together any propertie that acess directly a
checked element item.
So, it's needed iterate through array, until find the checked element and
return your value.
Some like this:

/**
 * parameter: the array of the radio or checkbox
 * return: the value of the checked item
 * example of use: var Country = foo(window.document.forms[0].Country);
 */
function foo(theObjArr)
{
	for(var i = 0; i < theObjArr.length; i++) {
		if(theArrObj[i].checked) {
			return theArrObj[i].value;
		}
	}
	return "";
} /* end */


I wait help you. See you later!


-----Mensagem original-----
De: javascript-request at LaTech.edu [mailto:javascript-request at LaTech.edu]
Enviada em: sábado, 10 de janeiro de 2004 16:00
Para: javascript at LaTech.edu
Assunto: Javascript Digest, Vol 11, Issue 4


Send Javascript mailing list submissions to
	javascript at LaTech.edu

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.LaTech.edu/mailman/listinfo/javascript
or, via email, send a message with subject or body 'help' to
	javascript-request at LaTech.edu

You can reach the person managing the list at
	javascript-owner at LaTech.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Javascript digest..."


Today's Topics:

   1. checked values of the radio and checkbox items (DEV)


----------------------------------------------------------------------

Message: 1
Date: Fri, 9 Jan 2004 17:58:59 -0800
From: "DEV" <dev at qroute.net>
Subject: [Javascript] checked values of the radio and checkbox items
To: "[JavaScript List]" <javascript at LaTech.edu>
Message-ID: <000d01c3d71d$5053abb0$0efd7b41 at mustafa>
Content-Type: text/plain;	charset="iso-8859-1"

On Form submit time, how do you report the checked values of the radio and
checkbox items ?

As you know this is a one liner when it comes to a select box.
var
Country=window.document.forms[0].Country.options[window.document.forms[0].Co
untry.selectedIndex].value



------------------------------

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


End of Javascript Digest, Vol 11, Issue 4
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040113/787ec867/attachment.htm>


More information about the Javascript mailing list