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:
2) Access parent page control from iframe directly and write the function on the page inside iframe to access the TextBox as:
here "ContentPlaceHolder1_TextBox1 " is the ID of the TextBox generated on parent page that you will have to find inside your page source.