neriah_d
08-22-2005, 02:36 PM
I currently have 6 options in which a user MUST select 3 choices... no more... no less... I currently have a script in place that doesn't allow you to check more than 3 however you can not check anything and it goes through which is NOT what needs to happen.
Here is my current JS:
<Script Language=JavaScript>
var currCount = 0;
var maxCount = 3;
function CountChecks(isBox){
if (isBox.checked){currCount++}
else {currCount--}
if (currCount > maxCount)
{
alert('You may only select ' + maxCount + ' magazines for this package.');
currCount--;
isBox.checked = false;
}
}
</Script>
Jonny Lang (on this site) gave me the 'how-to' on my initial script... I hope you're out there and can help me add this portion to it... ;) ~hint hint~ :D
How may I add that there must be 3 checked or else it won't go on???
I can't call the individual names of the checkboxes in this script otherwise it won't work because the names are referring to specific ID #'s... I have to have this function run through as an add on to my current function or as a separate function that does not call upon the checkboxes individual names.
Here is my current JS:
<Script Language=JavaScript>
var currCount = 0;
var maxCount = 3;
function CountChecks(isBox){
if (isBox.checked){currCount++}
else {currCount--}
if (currCount > maxCount)
{
alert('You may only select ' + maxCount + ' magazines for this package.');
currCount--;
isBox.checked = false;
}
}
</Script>
Jonny Lang (on this site) gave me the 'how-to' on my initial script... I hope you're out there and can help me add this portion to it... ;) ~hint hint~ :D
How may I add that there must be 3 checked or else it won't go on???
I can't call the individual names of the checkboxes in this script otherwise it won't work because the names are referring to specific ID #'s... I have to have this function run through as an add on to my current function or as a separate function that does not call upon the checkboxes individual names.