function GetInitialGridValues(grdID) {
debugger;
var szAdd = "", szUpdate = "";
var inputTags;
var selectTags;
document.forms[0].hidDefaultValues.value = "";
document.forms[0].hidDefaultNames.value = "";
if (grdID != null) {
inputTags = grdID.getElementsByTagName("input");
selectTags = grdID.getElementsByTagName("select");
} //Here getting all the text box and check boxes
else {
alert('grdID is null');
}
for (index = 0; index < inputTags.length; index++) {
if (String(inputTags[index].type) == "text") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].value + "~";
}
else if (String(inputTags[index].type) == "checkbox") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].checked + "~";
}
else if (String(inputTags[index].type) == "radio") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].checked + "~";
}
}
for (index = 0; index < selectTags.length; index++) {
if (String(selectTags[index].type) == "select-one") {
if (selectTags[index].length == 1) {
defVal = selectTags[index].options[0].text;
}
else {
for (var optCounter = 0; optCounter < selectTags[index].length; optCounter++) {
if (selectTags[index].options[optCounter].selected) {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + selectTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + selectTags[index].options[optCounter].text + "~";
break;
}
}
}
}
}
return false;
}
debugger;
var szAdd = "", szUpdate = "";
var inputTags;
var selectTags;
document.forms[0].hidDefaultValues.value = "";
document.forms[0].hidDefaultNames.value = "";
if (grdID != null) {
inputTags = grdID.getElementsByTagName("input");
selectTags = grdID.getElementsByTagName("select");
} //Here getting all the text box and check boxes
else {
alert('grdID is null');
}
for (index = 0; index < inputTags.length; index++) {
if (String(inputTags[index].type) == "text") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].value + "~";
}
else if (String(inputTags[index].type) == "checkbox") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].checked + "~";
}
else if (String(inputTags[index].type) == "radio") {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + inputTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + inputTags[index].checked + "~";
}
}
for (index = 0; index < selectTags.length; index++) {
if (String(selectTags[index].type) == "select-one") {
if (selectTags[index].length == 1) {
defVal = selectTags[index].options[0].text;
}
else {
for (var optCounter = 0; optCounter < selectTags[index].length; optCounter++) {
if (selectTags[index].options[optCounter].selected) {
document.forms[0].hidDefaultNames.value = document.forms[0].hidDefaultNames.value + selectTags[index].id + "~";
document.forms[0].hidDefaultValues.value = document.forms[0].hidDefaultValues.value + selectTags[index].options[optCounter].text + "~";
break;
}
}
}
}
}
return false;
}