In need of some advice regarding a javascript
function I've been working on:
function validateFile() {
var file = document.getElementById('fuCSV');
if (file.value == "") {
document.getElementById('<%=lblStatus.ClientID%>').innerhtml = "Please select a file to upload. Client!";
return false;
}
else {
document.getElementById('<%=lblStatus.ClientID%>').innerhtml = "";
return true;
}
}
I have been calling this function on the Button's OnClientClick
event like so:
<asp:Button ID="btnImport" runat="server" Text="Import" OnClientClick="return validateFile();" CausesValidation = "true"
UseSubmitBehavior ="true" OnClick="btnImport_Click" />
Although I'm attempting to modify the text of the label lblStatus
within the validateFile()
method, the text is not updating as expected. Interestingly, during debugging...QuickWatch shows the changed value. Any thoughts on what could be causing this issue? How might I go about resolving it?