Hey ismailc,
The approach to use is, when the button is clicked, to get it to run a java script function. I gather you're already doing this. This function checks each form element, to see whether it is empty. Let me show you an example from a website I built recently.
The form (the important part) looked like this:
-
Name:<input type="text" name="contact"><br>
-
<textarea rows="10" cols="60" name="feedback"></textarea><br>
-
The code (part of it) looked like this:
-
function validate()
-
{
-
input1=document.forms[0].contact.value;
-
input2=document.forms[0].feedback.value;
-
if(input1=="")
-
{
-
alert("Please provide your contact details");
-
}
-
else if(input2=="")
-
{
-
alert("You have posted no comments!");
-
}
-
else
-
{
-
document.forms[0].submit()
-
}
-
}
-
Of course, here the button is always visible - to make a dynamically appearing button is harder, but since you sound like you're in a bit of a hurry this should be find.
Your button to call the function could be a link or a HTML button. Remember also to give the form somewhere to submit to.
regards,
lars