Im trying to set a value to element (id ctl30_txtTextBox) in javascript.
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "IndexMask.aspx/AttachBarcodeFile",
dataType: "json",
data: params,
success: function() {
$("#<%= DummyPostbackButton.ClientID %>").click();
var someOtherName = "abc";
var element = document.getElementById("ctl30_txtTextBox");
element.Value = someOtherName;
alert(element.value.toString());
},
error: function(request, status, error) {
alert("Error attaching barcode file.");
}
});
Im getting the element, but the value is never set.
If i set a value on the page the alert is displayed with the correct value.
What am i doing wrong?
Javascript is case-sensitive, so it should be: