Re: Checked checkboxes

From: Roland Hall (nobody_at_nowhere)
Date: 02/23/05


Date: Tue, 22 Feb 2005 18:50:48 -0600


"Rolf Rosenquist" <rolf@nomail.com> wrote in message
news:OsT8QaSGFHA.1140@TK2MSFTNGP10.phx.gbl...
:I have not meant that this way was wrong. As I mentioned in other mails
here
: during the ride, I am not so familiar with Javasript, that I can decide
: that. Therefore when you gave me your tip, I was (and am) too ignorant to
do
: the rest needed to make it work. Some other kind guys helped me to get it
: working after some postings back and forth and I now have another puzzle
: piece to look at and try to learn more out of it, now that I have a
: solution.

For Dave...

<script type="text/javascript">
// Written by Roland Hall - http://kiddanger.com/lab/check1.html
function verifycheckboxes() {
 var ok = false;
 var e = document.getElementsByName('datum'); // Following Dave's advice
 for(var i = 0; i < e.length; i++) {
  e[i].checked ? ok = true : null;
  if(ok) { return true };
  }
  alert("You have to check at least one!");
  return false;
 }
</script>

-- 
Roland Hall
/* This information is distributed in the hope that it will be useful, but 
without any warranty; without even the implied warranty of merchantability 
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Relevant Pages

  • Re: Checked checkboxes
    ... Roland Hall wrote: ... during the ride, I am not so familiar with Javasript, that I can ...
    (microsoft.public.scripting.jscript)
  • Re: Get information from an other program
    ... I have a little pice of javascript where it works. ... var TE = new ActiveXObject; ... var xmlDoc = new ActiveXObject ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.vbscript)
  • Re: phpmailer and spam
    ... mails from my site, but i can't figure out why those mails are seen as ... Gmail seems to look them better and allows ... var $SMTPAuth = true; ... I require the password at email compose time to reduce the possibility of my site being used to forge emails to others.. ...
    (comp.lang.php)
  • Re: Calling stored procedure - JScript
    ... : var col = rs.Fields.count ... var conn = Server.CreateObject ... var arr = rs.GetRows ... without even the implied warranty of merchantability ...
    (microsoft.public.inetserver.asp.db)
  • Re: phpmailer and spam
    ... mails from my site, but i can't figure out why those mails are seen as ... spam by yahoo and hotmail. ... Gmail seems to look them better and allows ... var $SMTPAuth = true; ...
    (comp.lang.php)

Quantcast