Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post

    Change address link within object/ iFrame using form/ simple embedded browser

    Hello,

    I have some trouble trying to create a JavaScript browser, having the source of the object/ iFrame be changed using a normal html form without a prompt (so exclude the document.getElementById('theframe').src = prompt("Type in URL",""); and use something like <textarea rows="" cols="" name="textarea1"></textarea> instead). So I was trying to find something other than window.open or anything that replaces the entire page of the content, but still shows the form.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Testing</title>
    
    <script type="text/javascript">
    parent.document.getElementById('theframe').src = "http://www.google.com";
    document.getElementById('theframe').src = prompt("Type in URL",""); 
    </script>
    </head>
    <body>
    <iframe id="theframe" name="theframe" src="http://www.google.com" width="400" height="400">
    </body>
    </html>
    I've tried and experimented with different types of ways, using the window. formula, but could not figure it out. In addition, I think the parent object is not working; I tried to make a default link for that as well.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    Not quite sure what you are asking. Do you want the result of what they type in the textarea to be displayed on the page beneath (or above) the form? Or are you tyring to create links based on user input in that textarea?

    Either way, have you tried using the simple "innerHTML" function and assigning it to a span within your page?

    I've I've missed your point, please let me know and I'll try to provide a different solution based on your updated info.

  • #3
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Quote Originally Posted by EpicWebDesign View Post
    Not quite sure what you are asking. Do you want the result of what they type in the textarea to be displayed on the page beneath (or above) the form? Or are you tyring to create links based on user input in that textarea?

    Either way, have you tried using the simple "innerHTML" function and assigning it to a span within your page?

    I've I've missed your point, please let me know and I'll try to provide a different solution based on your updated info.
    I am trying to create what would be a mini-browser using a form. Whatever the user types into the text area will be what is displayed only within the object. In the attached image is an example of close to what it probably looks like.

    As you can see, after the user types a certain URL and submits it, the website displays in the object (in this example I did not use an iFrame). In other words, if I type "http://google.com" in the URL text area and submit it, then the Google site will show in the object.
    Attached Thumbnails Attached Thumbnails Change address link within object/ iFrame using form/ simple embedded browser-embed_browser.jpg  
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •