b007
Sep 1st 2008, 10:53 am
Hi,
I got a validation script and a confirm script,
I want that if the validation return false than no to do the confirm func.
just return a msg in the lable text as it does.
and if the validation return true than do the confirm func.
and if I press on ok at the confirm than return true , cancel return false.
My 2 Scripts are:
function Validate()
{
var radiobuttonList = document.getElementsByName("MyRadioButton1");
var isSelected = false;
for( i=0; i<radiobuttonList.length;i++)
{
if (radiobuttonList[i].checked)
{
isSelected = true;
}
}
if(!isSelected)
document.getElementById("lblTEXT1").innerText = "Must select a row";
return isSelected;
}
--------------
function confirmDelete()
{
var answer = confirm("?are u sure")
if (answer)
{
alert("msg delete");
return true;
}
else
{
alert("msg not delete");
return false;
}
}
How to do that?
Thanks, Gil
I got a validation script and a confirm script,
I want that if the validation return false than no to do the confirm func.
just return a msg in the lable text as it does.
and if the validation return true than do the confirm func.
and if I press on ok at the confirm than return true , cancel return false.
My 2 Scripts are:
function Validate()
{
var radiobuttonList = document.getElementsByName("MyRadioButton1");
var isSelected = false;
for( i=0; i<radiobuttonList.length;i++)
{
if (radiobuttonList[i].checked)
{
isSelected = true;
}
}
if(!isSelected)
document.getElementById("lblTEXT1").innerText = "Must select a row";
return isSelected;
}
--------------
function confirmDelete()
{
var answer = confirm("?are u sure")
if (answer)
{
alert("msg delete");
return true;
}
else
{
alert("msg not delete");
return false;
}
}
How to do that?
Thanks, Gil