Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:01:30+00:00 2026-05-25T18:01:30+00:00

I have a web page that contains two textboxes and a button. I can’t

  • 0

I have a web page that contains two textboxes and a button. I can’t control this page by adding any thing to it, or changing any thing in it.

I want to (in some way) write some text in the first textbox when the page loads, without pressing the button.

I want to put the page in a frame and then control it from the container page

I know that I have to use jquery but I need a sample that explain that or to tell me how to do what I want

For example, if I have the file “a.htm”:

The content of “a.htm”:

<iframe id="frame1" src="f.htm" />

and the content of “f.htm” is:

<input type="textbox" id="tbx1" />
<input type="textbox" id="tbx2" />
<input type="submit" id="okbtn" value="ok"/>

For example, when the page “a.htm” loads, I want the textbox (“tbx1” for example) in the page “f.htm”, (contained in the frame “frame1”) to be filled by some text.

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:01:31+00:00Added an answer on May 25, 2026 at 6:01 pm

    Before I start on this answer, it’s worth explaining that you cannot use JavaScript alone to manipulate a frame which serves content from a separate domain*. In other words, if your page, a.htm, is on your domain (e.g. http://yourdomain.com/a.htm), and f.htm is on another domain (e.g. http://someothersite.com/f.htm), then JS will not be able to access anything inside the iframe.

    *There are techniques available to do this, but as a rule of thumb they cause more trouble than good.

    However, if it’s all on the same domain you should have no trouble. In a.htm, to access the iframe, you could use the following jQuery snippet:

    $(function() {
      var iframe = $('#frame1').load(function() {
        $(this).contents().find('#tbx1').val('Text in a box!');
      });
    });
    

    So, your a.htm could look like:

    <html>
      <head>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script type="text/javascript">
          $(function() {
            var iframe = $('#frame1').load(function() {
              $(this).contents().find('#tbx1').val('Text in a box!');
            });
          });
        </script>
      </head>
      <body>
        <iframe id="frame1" src="f.htm" />
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET web page that contains many textboxes. Each textbox has a
I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)
I have a web page that contains two lists (Unorders lists), I have to
In a web application, I have a page that contains a DIV that has
I have a web page that consists of a checkbox (parent) and on this
I have a web page that includes a bunch of images. Sometimes the image
I have a web page that displays a long line graph inside a div
I have a web page that is being displaying in a winform app using
I have a web page that renders the same in IE7, Firefox, and Safari
I have a web page that displays a list of documents stored on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.