Wenn die Schaltfläche angeklickt wird, springt der Fokus auf DropdownList. Irgendwelche Ideen?HTML

HTML-Programmierer
Anonymous
 Wenn die Schaltfläche angeklickt wird, springt der Fokus auf DropdownList. Irgendwelche Ideen?

Post by Anonymous »

Wir haben eine Web -App, die seit 2018 perfekt ausgeführt wird, bis wir eine geringfügige Änderung vorgenommen haben. Schaltfläche zum Hinzufügen einer neuen Zeile, obwohl die neue Zeile erstellt wird, aber die Maus springt schnell und konzentriert sich auf den Dropdown.

Code: Select all

         



























*Check this box if N/A









































// vb

Code: Select all

   Protected Sub ddlChoice_Changed(ByVal sender As Object, ByVal e As EventArgs)

If ddlChoice.SelectedItem.Value = "CardNo" Then

pnlCardNo.Visible = True

pnlSSNO.Visible = False

Else

pnlCardNo.Visible = False

pnlSSNO.Visible = True

End If

End Sub
// js

Code: Select all

function BtnClick() {
var val = Page_ClientValidate();
if (!val) {
var i = 0;
for (; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid) {
$("#" + Page_Validators[i].controltovalidate)
.css("border-color", "red");
}
}
}
return val;
}

< /code>
 0 Then
Dim txtsoname As TextBox = Nothing
Dim txtsoaddress As TextBox = Nothing

For i As Integer = 1 To dtCurrentTable.Rows.Count
'extract the TextBox values
txtsoname = DirectCast(Gridview1.Rows(rowIndex).Cells(1).FindControl("txtsourcename"), TextBox)
txtsoaddress = DirectCast(Gridview1.Rows(rowIndex).Cells(2).FindControl("txtsourceaddress"), TextBox)

drCurrentRow = dtCurrentTable.NewRow()
drCurrentRow("RowNumber") = i + 1

dtCurrentTable.Rows(i - 1)("sourcename") = txtsoname.Text
dtCurrentTable.Rows(i - 1)("sourceaddress") = txtsoaddress.Text

rowIndex += 1
Next
If Not String.IsNullOrEmpty(txtsoname.Text) AndAlso Not String.IsNullOrEmpty(txtsoaddress.Text) Then
dtCurrentTable.Rows.Add(drCurrentRow)
Else
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Confirm", "jAlert('Please complete first row before adding a new row!');", True)
End If
'dtCurrentTable.Rows.Add(drCurrentRow)
ViewState("CurrentTable") = dtCurrentTable

Gridview1.DataSource = dtCurrentTable
Gridview1.DataBind()
End If
Else
Response.Write("ViewState is null")
End If

SetPreviousData()
Ende sub
Irgendwelche Ideen, wie man dieses Problem behebt?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post