If you have the textbox on masterpage this will work.
var txtValue = window.parent.form1.txtCategory.value;
But, if you have TextBox inside ContentPlaceHolder, there are two ways:
1) Write a function in parent page that does your task and call the function from page inside iframe as:
parent.yourParentPageFunction();
2) Access parent page control from iframe directly and write the function on the page inside iframe to access the TextBox as:
alert(parent.document.getElementById("ContentPlaceHolder1_TextBox1").value);
here "ContentPlaceHolder1_TextBox1 " is the ID of the TextBox generated on parent page that you will have to find inside your page source.