i am calling this function when the user clicks on More/less criteria button in our webpage.that is if u click on MoreCriteria Button it gives more options to search in our web page.My question is when u minimize the website to about 1/4 of the screen width horizontally the website locksup nothing works and we have to purposely close the web page.so i need a solution for it that is it shouldnot lockup.
I have find the line where it gets lockup that is: script += " document.all('" + AdvCritTableIdOrReflowTagId + "').Show('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";
If could anyone tell me what could be replacement code for the above mention line.
Programing langauge used is ASP,Javascript
Browser:IE7,IE8,IE6
function AddMoreLessButton(strMoreLiteral, strLessLiteral, inpAdvActiveValue,
formName, hdnInpAdvActiveName, AdvCritTableIdOrReflowTagId, advCriteriaPropertyName,
advCriteriaPropertyValue, oStringBuilder)
{
var val;
if(inpAdvActiveValue == "1") val = strLessLiteral; else val = strMoreLiteral;
var btn = "<input type='button' class='btn' name='btnMoreCriteria' id='btnMoreCriteria'";
btn += " value='" + val + "'";
btn += " onclick='MoreCriteriaClicked(); return false;'";
btn += " morelit='" + strMoreLiteral + "' lesslit='" + strLessLiteral + "'/>";
if(oStringBuilder){
oStringBuilder.Append(btn);
} else {
Response.Write(btn);
}
var script = "<";
script += "script language=javascript defer='defer'>";
script += " function MoreCriteriaClicked(){ ";
script += " var oBtn = document.all('btnMoreCriteria'); ";
script += " if(oBtn.value == oBtn.morelit) DisplayMoreCriteria(oBtn);";
script += " else DisplayLessCriteria(oBtn); } ";
script += "function DisplayMoreCriteria(oBtn){";
script += "try{";
script += " try{";
script += " oBtn.style.display = '';";
script += " document.all('" + AdvCritTableIdOrReflowTagId + "').Show('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";
script += " }catch(e){ document.all." + AdvCritTableIdOrReflowTagId + ".style.display='inline';}";
script += " document.forms." + formName + "." + hdnInpAdvActiveName + ".value = '1';";
script += " oBtn.value = oBtn.lesslit;}catch(e){}}";
script += "function DisplayLessCriteria(oBtn){";
script += "try{";
script += " try{";
script += " oBtn.style.display = '';";
script += " document.all('" + AdvCritTableIdOrReflowTagId + "').Hide('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";
script += " }catch(e){ document.all." + AdvCritTableIdOrReflowTagId + ".style.display='none';}";
script += " document.forms." + formName + "." + hdnInpAdvActiveName + ".value = '0';";
script += " oBtn.value = oBtn.morelit;}catch(e){}}";
if(inpAdvActiveValue == "1"){
script += "objILConstructors.register(function(){var oBtn = document.all('btnMoreCriteria'); DisplayMoreCriteria(oBtn);});";
script += "var oBtn = document.all('btnMoreCriteria');";
script += " DisplayMoreCriteria(oBtn);";
}
else
{
script += "objILConstructors.register(function(){var oBtn = document.all('btnMoreCriteria');DisplayLessCriteria(oBtn);});";
}
script += " AdvActiveNodeName='" + hdnInpAdvActiveName + "';";
script += " <\/script>";
if(oStringBuilder){
oStringBuilder.Append(script);
} else {
Response.Write(script);
}
}