
Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name label and registeration label in this two labels.If one we have selected then the other one should become optional.This is the problem sir.please help me regarding this promblem.
please help me as soon as possible sir.. Thanks for sending me the answeres for previous queries..
Thanks in advance teja

Hi Friend,
Try the following code:
<html>
<head>
<script>
function validate(){
var n=document.form.name.value;
var r=document.form.reg.value;
if((n=="")&&(r=="")){
alert("*You have to attempt aleast one field!It is mandatory");
return false;
}
if((n=="")&&(r!="")){
alert("*Name field is optional!");
return true;
}
if((r=="")&&(n!="")){
alert("*Registration field is optional!");
return true;
}
return true;
}
</script>
</head>
<form name="form" method="post" onSubmit="return validate()" >
<table>
<tr><td>Name:</td><td><input type="text" size="20" name="name"></td></tr>
<tr><td>Registration:</td><td><input type="text" size="20" name="reg"></td></tr>
<tr><td><input type="submit" value="Check"></td></tr>
</table>
</form>
</html>
Thanks