Hi rathi,
i have a
pattern soln for ur problem, so u try it out with the following code by changing variable with reference to ur application. so u r telling u have 10 buttons. so most probably u have to use this for 10 times or u can simplify by writing java script using some loops.
refer this code sample.
add the html statement in body of ur html code or form tag of u html code and
write the java script in head section of the html as given below
function validation()
{
//Flag for checking for Submiting the FORM for Saving or Not
var flgSub="0";
var ictr = 0;
var c1 = "";//variable for checking whether Check box checked or not.
for(ictr=0;ictr<(document.forms[0].elements.length)-1;ictr=ictr+1)
{
//Checkbox
c1=document.forms[0].elements[ictr].checked;
//alert("Chk box name = "+ document.forms[0].elements[ictr].name +" value = "+c1);
if (c1==true)
{
flgSub = "1";
}
}
if (flgSub=="1")
{
var confirmok = false;
confirmok = window.confirm("Do you want to send payslip throug E-mail?");
if (confirmok == true)
{
document.forms[0].method="post";
document.forms[0].target="";
document.forms[0].action="createallpdf.jsp";
document.forms[0].submit();
}
}
else
{
alert(" Sorry ! No Records Selected to submit");
}
}
try it with this .like this i have used for my problem and it as solve.
have a nice time
with regards