I don't understand what is wrong with my code. It is very basic, but still there is an error.
In the header tag I have the following script, you can skip your attention to the last function, which is the one I need for this question:
<script type="text/javascript">
function allowOnlyNumber(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46)
return false;
return true;
}
function checkboxalert() {
var active = document.getElementById("chkActive").checked;
var inactive = document.getElementById("chkInactive").checked;
if ((!active) && (!inactive)) alert("Please ensure that either Active or Inactive is checked before limiting search, otherwise, Active records will be assumed...")
}
function lostfocusLowPrice() {
if (getElementById("txtFindHighPrice").value = "" && getElementById("txtFindLowPrice").Value != "") getElementById("txtFindLowPrice").Value = getElementById("txtFindLowPrice").Value;
}
</script>
In the design of my web page, I have this:
<asp:TextBox ID="txtFindLowPrice" OnTextChanged="lostfocusLowPrice()" onkeypress="return allowOnlyNumber(event)" runat="server" Height="22px" Width="63px"></asp:TextBox>
I get a compilation error:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'webform1_aspx' does not contain a definition for 'lostfocusLowPrice' and no extension method 'lostfocusLowPrice' accepting a first argument of type 'webform1_aspx' could be found (are you missing a using directive or an assembly reference?)
Spelling matches. Code is very basic. Can't imagine what it might be. Other javascript functions work fine.
Any ideas?