hello,
i want click on button through javascript
<asp:Button ID="Button2" Text="Upload" runat="server" OnClick="Button1_Click" />
function Validate() {
$("div[class=loadpost]").each(function (index) {
var textbox1 = $(this).find('[id*=TextBox3]').val();
if (textbox1 != '') {
var destination = $(this).find('[id*=TextBox4]').val();
var length = $(this).find('[id*=TextBox6]').val();
var weight = $(this).find('[id*=TextBox7]').val();
if (destination == '' || length =='' || weight =='' ) {
alert("Destination, Weight,Length. min one equipment type is required field is required on rows " + (index + 1));
}
else {
document.getElementById("<%=Button2.ClientID %>").click();
alert("success " + (index + 1));
}
}
});
return false;
}
i am not sure why button is not clicked