单选按钮焦点在chrome中有效,但在IE中不起作用

时间:2019-06-06 23:56:59

标签: jquery asp.net

我有3个单选按钮,是,否,我不想回答。使用下面的代码,当您选中“是”时,它将在Chrome中工作,将焦点保留在“是”上,当您将其选中时,将焦点保持在所有自动回发的位置,但在IE中不起作用。请指教。我尝试添加{2}并将焦点停留在IE中的位置,但没有自动回发“ no”检查,这也给我在{2}处出现编译错误,它指出格式字符串包含无效的占位符。谢谢。

焦点停留在单选按钮上,该单选按钮用于检查chrome,但不能用于IE。焦点跳回到IE中的页面顶部。

  rblDisabilityTx.Focus()
  ScriptManager.RegisterStartupScript(Me, Me.GetType, rblDisabilityTxTriggerFocus", String.Format("$('#{0}_{1}_{2}').focus();", rblDisabilityTx.ClientID, rblDisabilityTx.SelectedIndex),True)

Private Sub rblDisabilityTx_SelectedIndexChanged(sender As Object, e As EventArgs) Handles rblDisabilityTx.SelectedIndexChanged
  pnlTxDisabilityItems.Visible = (rblDisabilityTx.SelectedValue = "1")
  If Not pnlTxDisabilityItems.Visible Then
    cblCategoryOfDisability.ClearSelection()
      For Each item As ListItem In cblCategoryOfDisability.Items
        item.Enabled = True
      Next
    rblConcernDisability.ClearSelection()

  End If

  ScriptManager.RegisterStartupScript(aupTxDisability,   aupTxDisability.GetType, rblDisabilityTxTriggerFocus", String.Format("$('#{0}_{1}').focus();", rblDisabilityTx.ClientID, rblDisabilityTx.SelectedIndex), True)
End Sub
<asp:UpdatePanel ID="aupTxDisability" runat="server" UpdateMode="Conditional">
  <ContentTemplate>
    <GSI:GSIContainer ID="cntHasDisabilityTx" runat="server" ForControl="rblDisabilityTx" Label="<% $ Resources: DisabilitySubstantial%>" IncludeLabelColon="False" Width="100%" LabelWidth="263px">
      <asp:RadioButtonList ID="rblDisabilityTx" runat="server" AutoPostBack="true" Style="float: left;" role="radiogroup" aria-label="<% $    Resources: DisabilitySubstantial%>">
        <asp:ListItem Value="1" Text="<%$ Resources: DisabilitySubstantialYes %>" />
        <asp:ListItem Value="0" Text="<%$ Resources: DisabilitySubstantialNo %>"    />
        <asp:ListItem Value="9" Text="<%$ Resources: DoNotWishToAnswer %>" />
      </asp:RadioButtonList>
    </GSI:GSIContainer>

0 个答案:

没有答案