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 8895579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:49:01+00:00 2026-06-14T23:49:01+00:00

I want to have a textbox in my HTML page, and also an iframe

  • 0

I want to have a textbox in my HTML page, and also an iframe. When the user types in a URL in the textbox and clicks Submit, the iframe navigates to that page. When the user clicks a link within the iframe, the URL in the textbox also changes to the new URL. Is it possible?

NOTE: Solutions not using iframe are welcome, but they should achieve roughly the same functionality as iframe.

  • 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-06-14T23:49:03+00:00Added an answer on June 14, 2026 at 11:49 pm

    Give your text box a id for example “txtInput”
    give your iframe a id for example “myIframe”
    on the button give it no navigation so it stays on current page and use the onclick=”myFunction()”

    in the function you can use this (excuse me if this is slightly wrong its been a while since I have used HTML

        function myFunction()
        {
            var iframe = document.getElementById("myIframe");
            var input = document.getElementById("txtInput").text;
    
    //check to see if there is a valid url in the text box be carefull if there are multiple links in the text box it will put them all in and the iframe will go to 127.0.0.1 or search engine due to incorrect URL
            var isURL=new RegExp(/(((f|ht)(tp|tps):\/\/)[\w\d\S]+)/,g);
    
            iframe.src = input.match(isURL);
        }
    

    If you do not want to mess with regular expresions you can just simply use the following.

    function myFunction()
    {
        var iframe = document.getElementById("myIframe");
        var input = document.getElementById("txtInput").text;
    
        iframe.src = isURL;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a textbox in my HTML page, and also an iframe
I have a Multiline Textbox . I donot want to let user type HTML
I want to make phone based textbox in my html-page. someone have idea how
I have a textbox in a form that I created. I want to add
I have a search page that contains a textbox for the search and a
I am creating a web page, where I have an image that I want
So I have this textbox on the page: <%= Html.TextBox(EffectiveDate, Model.EffectiveDate.HasValue ? Model.EffectiveDate.Value.ToString(dd-MMM-yyyy) :
I have an Iframe for a page that allows people to sign up for
I have a textbox and want an event triggered whenever it is updated, whether
I have a textbox with ID name, I want to do validation when 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.