Help With a Bit of JScript?

Carlton Brown cbrown at mail.duke.edu
Fri Jun 7 15:47:59 EDT 2002


Hi,

I'd like to add an "if..then" test which alerts the user if more than a
certain # of checkboxes are chosen. Something along the lines of:

if (+ total + > 6){
alert ("You chose + total + boxes.\nYou may only choose up to 5.")
}
-------------------------------------
Here's the script as it is now :

<!-- Begin
function anyCheck(form) {
var total = 0;
var max = form.ckbox.length;
for (var idx = 0; idx < max; idx++) {
if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
    total += 1;
   }
}
alert("You selected " + total + " boxes.");
}
//  End -->
</script>

Please copy me if you reply to the list, and thanks for any time and
assistance you can spare.
--
Carlton Brown
Systems/Cataloging Librarian/Web Specialist
Ford Library - The Fuqua School of Business
http://www.lib.duke.edu/fsb/
v:919-660-7871
f:919-660-7950




*********************************************************************
Due to deletion of content types excluded from this list by policy,
this multipart message was reduced to a single part, and from there
to a plain text message.
*********************************************************************



More information about the Web4lib mailing list