JavaScript runs on the client, your aspx files are on the server. This code
stno = document.getElementById("txtfnumber").value;
is looking for an element with an id of "txtfnumber". Your aspx page has a server tag with that ID, but javascript uses what is sent to the browser, so view the source of the page and see if there is an element in the source with that ID. asp.net changes the IDs of your controls in various situations so you need to use .net to generate the right ID in your javascript.
stno = document.getElementById("<%=txtfnumber.ClientID%>").value;