javascript code, this code is working in IE browser but not in other browsers

Kolamarun
Posted by Kolamarun under JavaScript category on | Points: 40 | Views : 636
<script type="text/javascript" language="javascript">
function CheckSelected(Type){
var grid=document.getElementById("<%= gvCentersList.ClientID %>")
var cell
var checkStatus=false
if(grid.rows.length>0){
for(i=1;i<grid.rows.length;i++){
cell=grid.rows[i].cells[0]
for(j=0;j<cell.childNodes.length;j++){
if (cell.childNodes[j].type == "checkbox") {
if(cell.childNodes[j].checked==true){
checkStatus=true}}}}}
if(!checkStatus){
if(Type==1){
alert('<%=Resources.Messages.DeleteAlert %>')
return false}
else if(Type==2){
alert('<%=Resources.Messages.ActivateAlert %>')
return false}
else if(Type==3){
alert('<%=Resources.Messages.DeactivateAlert %>')
return false
}
else if (Type == 4) {
alert('Select Record(s) to Enable Security')
return false
}
else if (Type == 5) {
alert('Select Record(s) to Disable Security')
return false
}
}
else{
var agree
if(Type==1){
agree=confirm('<%=Resources.Messages.DeleteConfirm %>')}
else if(Type==2){
agree=confirm('<%=Resources.Messages.ActivateConfirm %>')}
else if(Type==3){
agree = confirm('<%=Resources.Messages.DeactivateConfirm %>')
}
else if (Type == 4) {
agree = confirm('Are You Sure To Enable Security')
}
else if(Type==5){
agree = confirm('Are You Sure To Disable Security')
}
if(agree)
return true
else
return false}}
function ForEdit(Type){
var grid=document.getElementById("<%= gvCentersList.ClientID %>")
var cell
var checkEdit=0
if(grid.rows.length>0){
for(i=1;i<grid.rows.length;i++){
cell=grid.rows[i].cells[0]
for(j=0;j<cell.childNodes.length;j++){
if(cell.childNodes[j].type=="checkbox"){
if(cell.childNodes[j].checked==true){
checkEdit+=1}}}}}
if(checkEdit==1){
return true}
else{
if(Type==1)
alert('<%=Resources.Messages.EditAlert %>')
else if(Type==2)
alert('<%=Resources.Messages.AddUser %>')
return false}}
</script>

Comments or Responses

Login to post response