我有一個由一個文本框和按鈕組成的窗體。在一個按鈕上單擊一個彈出窗口出現,其中包含一個數據網格,我可以從中選擇值, textbox(使用javascript)。在IE6和IE7中,我可以從彈出的網格中選擇值,但在IE8中,Mozilla和Chrome iam無法選擇。可能是什麼原因。是否有人可以幫助解決此問題? 以下javascript我用來將彈出窗口中選定的值綁定到文本框。 函數回傳(FieldId,fieldValue方法) {datagrid/textbox在IE 6/7中工作,但不是其他人
if (window.opener && !window.opener.closed)
{
window.opener.document.getElementById(strFieldName).value = FieldValue;
window.opener.document.getElementById(strhidFieldName).value = FieldId;
window.opener.document.getElementById(strFieldName).focus();
window.close();
}
}
function openPopup(hidfield_name,field_name,SType)
{
url = location.protocol+'//'+ location.host + '/User/Search.aspx?refId='+field_name+'&SearchType='+SType+'&hidid='+hidfield_name;
if (!newwindow.closed && newwindow.location)
{
newwindow.location.href = url;
}
else
{
GetCenterWindowParams();
newwindow=window.open(url,'winLOV', 'scrollbars=yes,resizable=yes,width=470,height=400,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
以下是我在網格的數據綁定正在呼叫的代碼。
currentCell.Attributes.Add("OnClick", "javascript:PassBack('" & CType(e.Item.DataItem, DataRowView).Row(0) & "','" & str.Trim & "');")
您需要張貼一些代碼... – cgreeno 2009-06-08 09:45:39