k, ive posted this on server side board, but it seems dead on there, and i need an answer quickly…so sorry, but im desperate.
I have 4 checkboxes, is there away i can put a “Select all” button so it’ll do just that.
Also, i want it so one has to be selected in order to process the form, is there an alert box i could use if ones not selected
(p.s. i have used a simple mailto form, as i cant do php)
This is a client side question rather than server side
you’ll need a basic knowledge of javascript to understand the rest
the four checkboxes could be selected using JavaScript
behind the select all button have a call to the function below
function CheckAll(){
for (i=0;i<document.[name of form].[name of radiobuttons].length;i++){
document.[name of form].[name of radiobuttons].checked = true;
}
}
remember all the radiobuttons have to have the same name for this to work. And again when the form is submitted call this function
function Valid(){
lname = “”;
for (i=0;i<document.[name of form].[name of radiobuttons].length;i++){
if (document.[name of form].[name of radiobuttons].checked){
lname = [name of form].[name of radiobuttons].value
}
}
if (lname=="")
{ alert(“You have to select a radio button”); }
else
{ // whatever }
}