Here my code
<script type="text/javascript">
function validate()
{
var con=confirm("Are You Want to add More Packages");
if(con==true)
{
var radio1=document.getElementById('first_radio');
if(radio1.checked==true)
{
var a=document.getElementById('total').value;
b=(parseInt(a)+parseInt(a));
document.getElementById('total').value=b;
var c=confirm("Are You Want to add More Packages")
if(c==true)
{
}
}
}
else
{
alert("you clicked Cancel");
}
}
</script>
In this code i want to run that addition upto user click cancel in confirm alert. any one help? Thanks advance..
Try this,
<script type="text/javascript">
function validate()
{
var con=confirm("Are You Want to add More Packages");
if(con==true)
{
var radio1=document.getElementById('first_radio');
if(radio1.checked==true)
{
var a=document.getElementById('total').value;
b=(parseInt(a)+parseInt(a));
document.getElementById('total').value=b;
validate();// call this function again from here
}
}
else
{
alert("you clicked Cancel");
}
}
</script>