Try setting the textbox's ClientIDMode to Static
That way the javascript should be able to find them with the same ID as in ASPX.
Here a whole test page
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>