iframe Naviagate Textbox?

Type url in TextBox and Press button to navigate it?

Page 1 of 1

14 Replies - 7798 Views - Last Post: 05 June 2011 - 12:17 AM

#1 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

iframe Naviagate Textbox?

Posted 26 May 2010 - 08:38 AM

Well a lot of things changed while I was gone on this forum...
Anyways, onto my question.

Me and my cousin created this code where it has iframe, textbox, and a button. When I press the button, it won't go to google.com which is weird.

<html>
<body>
  <script language="Javascript">
    function funcNavigate() {
        window.navigate(site.value);
    }
  </script>
 <div align="center">
 <center>
    <table border="0" width="45%" bgcolor="#800080">
     <tr>
       <td width="100%" align="center">
        <p align="center"><font face="Comic Sans MS" size="7" color="#FFFFFF">
</font></td>
    </tr>
   </table>
 </center>
 </div>
   <center>
        <p></p>
   </center>
        <p align="center">
<input type="text" name="site" value="http://google.com">
            <input type="button" value="Go" onclick="funcNavigate();">
       </p>
	   <iframe src="/hidden/" width='100%' height='300'><p> You dont support iframe</p></iframe>
</body>
</html>


Can someone tell me what I did wrong?

Is This A Good Question/Topic? 0
  • +

Replies To: iframe Naviagate Textbox?

#2 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 09:40 AM

Only problem with this code is that I press the button but it won't go to google.com.
Was This Post Helpful? 0
  • +
  • -

#3 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 10:34 AM

Try making it a button and see what happens.
Was This Post Helpful? 0
  • +
  • -

#4 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 11:13 AM

View Postjohnmatthais, on 26 May 2010 - 09:34 AM, said:

Try making it a button and see what happens.


What do you mean? I already have a button on the site, I type a url inside the textbox, hit the button, nothing happens.
Was This Post Helpful? 0
  • +
  • -

#5 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 11:29 AM

Ah, I see. I'm not entirely sure. One thing you could try doing is removing the semicolon from the onclick instruction.

Other than that, I don't know. Try my first recommendation, and if that doesn't work, maybe someone else will catch it.
Was This Post Helpful? 0
  • +
  • -

#6 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 12:42 PM

View Postjohnmatthais, on 26 May 2010 - 10:29 AM, said:

Ah, I see. I'm not entirely sure. One thing you could try doing is removing the semicolon from the onclick instruction.

Other than that, I don't know. Try my first recommendation, and if that doesn't work, maybe someone else will catch it.


Hm... it doesn't work... but thanks for trying though.
Was This Post Helpful? 0
  • +
  • -

#7 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:07 PM

I did some research, and with this, it adds the URL on to the end of the current URL, but that's all it does. I still can't get it to go to the site. >.>

Anyways, see what you can do with this:

<html>
<body>
  <script language="text/javascript">
    function navigate() 
    {
        var url = document.forms[0].url.value;
        window.location = url;
        return false;
    }
  </script>
 <div align="center">
 <center>
    <table border="0" width="45%" bgcolor="#800080">
     <tr>
       <td width="100%" align="center">
        <p align="center"><font face="Comic Sans MS" size="7" color="#FFFFFF">
</font></td>
    </tr>
   </table>
 </center>
 </div>
   <center>
        <p></p>
   </center>
        <center>
<form action="" method="get" onsubmit="return navigate()">
            <input type="text" name="url" id="url">
            <input type="submit" value="Go">
</form>
       </center>
           <iframe src="/hidden/" width='100%' height='300'><p> You dont support iframe</p></iframe>
</body>
</html>


Was This Post Helpful? 0
  • +
  • -

#8 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:24 PM

Okay, apologies for double posting.

Technically, this should work. It's got window.open and its target is the variable, url, which is already proven to be pointed at the form entry by tests I've done. However, for some reason, it keeps tacking it on to the end of the URL. You try it. See if it works for you. >.>

<html>
<body>
  <script language="text/javascript">
    function navigate() 
    {
        var url = document.forms[0].url.value;
        window.open(url);
        return false;
    }
  </script>
 <div align="center">
 <center>
    <table border="0" width="45%" bgcolor="#800080">
     <tr>
       <td width="100%" align="center">
        <p align="center"><font face="Comic Sans MS" size="7" color="#FFFFFF">
</font></td>
    </tr>
   </table>
 </center>
 </div>
   <center>
        <p></p>
   </center>
        <center>
<form action="" method="get" onsubmit="return navigate()">
            <input type="text" name="url" id="url" value="http://www.google.com/">
            <input type="submit" value="Go">
</form>
       </center>
           <iframe src="/hidden/" width='100%' height='300'><p> You dont support iframe</p></iframe>
</body>
</html>


EDIT: Yeah, I know it's not exactly what you want, but I'm trying to do this piece by piece here because I'm not entirely sure what I'm doing, myself. xD

This post has been edited by johnmatthais: 26 May 2010 - 01:30 PM

Was This Post Helpful? 0
  • +
  • -

#9 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:33 PM

View Postjohnmatthais, on 26 May 2010 - 12:07 PM, said:

I did some research, and with this, it adds the URL on to the end of the current URL, but that's all it does. I still can't get it to go to the site. >.>

Anyways, see what you can do with this:

<html>
<body>
  <script language="text/javascript">
    function navigate() 
    {
        var url = document.forms[0].url.value;
        window.location = url;
        return false;
    }
  </script>
 <div align="center">
 <center>
    <table border="0" width="45%" bgcolor="#800080">
     <tr>
       <td width="100%" align="center">
        <p align="center"><font face="Comic Sans MS" size="7" color="#FFFFFF">
</font></td>
    </tr>
   </table>
 </center>
 </div>
   <center>
        <p></p>
   </center>
        <center>
<form action="" method="get" onsubmit="return navigate()">
            <input type="text" name="url" id="url">
            <input type="submit" value="Go">
</form>
       </center>
           <iframe src="/hidden/" width='100%' height='300'><p> You dont support iframe</p></iframe>
</body>
</html>



Ok well it does something, but instead of making it go to the url that is inside the textbox, for example: google.com inside the textbox, it doesn't go there, instead, it goes back to /hidden/
Was This Post Helpful? 0
  • +
  • -

#10 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:36 PM

View Postkoolazngy94, on 26 May 2010 - 12:33 PM, said:

Ok well it does something, but instead of making it go to the url that is inside the textbox, for example: google.com inside the textbox, it doesn't go there, instead, it goes back to /hidden/

Yeah, I tried fixing that in the second post I just had by opening a new window with said URL, but it wouldn't work for me for some reason, and instead had the exact same effect. *shrugs* I'm not a master at JS, if you can't tell. Just enjoy trying to help. ^^
Was This Post Helpful? 0
  • +
  • -

#11 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:41 PM

Yeah I can tell but once again, thanks for taking your time and helping me with this code.
Was This Post Helpful? 0
  • +
  • -

#12 johnmatthais  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 271
  • Joined: 21-January 09

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:43 PM

View Postkoolazngy94, on 26 May 2010 - 12:41 PM, said:

Yeah I can tell but once again, thanks for taking your time and helping me with this code.

Yeah, no problem.

I'm just not entirely sure what I did wrong that it won't even execute the window.open correctly in the second one I did there. *shrugs*
Was This Post Helpful? 0
  • +
  • -

#13 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 01:51 PM

I just wonder why that code won't work for some reason.
Was This Post Helpful? 0
  • +
  • -

#14 koolazngy94  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 29-July 08

Re: iframe Naviagate Textbox?

Posted 26 May 2010 - 07:05 PM

Any other help anyone?
Was This Post Helpful? 0
  • +
  • -

#15 mcrear  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-June 11

Re: iframe Naviagate Textbox?

Posted 05 June 2011 - 12:17 AM

View Postkoolazngy94, on 26 May 2010 - 07:05 PM, said:

Any other help anyone?



I want to ask something :(
could anyone resolved this problem ?

Im using asp.net
And I want to this;
there is a textbox a button and an iframe in a web form
I'll write an url into the textbox and I'll click button
it shows me that site into the iframe

if I write something wrong, sorry. I dont know very well english.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1