47 users online (1 members and 46 guests)  


Page 5 of 5 First 1 2 3 4 5
  Results 61 to 70 of 70

Related

  1. Replies: 0
  2. open url from text box    Forum: Javascript Forum
    Replies: 1
  3. how to open save/open dialog using HTML    Forum: HTML Forum
    Replies: 1
  4. open url from text box    Forum: Javascript Forum
    Replies: 5
  1. #61
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    Oh, one more thing. Is there a way you can have MULTIPLE input boxes (the same code you gave me in post #58) on the same page that load pages off different links? Like if you enter "KEYWORD" in one, it'll load www(dot)address(dot)com/KEYWORD and if you enter "KEYWORD" in the other one, it'll load, say, www(dot)address(dot)com/something/KEYWORD.

  2. #62
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: open url from text box? pls help

    Hi there lasko,

    this can be done like this...
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title></title>
    
    <style type="text/css">
    #wrapper {
        width:482px;
        margin:auto;
     }
    .container {
        float:left;
        width:195px;
        border:3px double #000;
        padding:10px 10px 0;
        font-family:sans-serif;
        color:#000;
        text-align:center;
        background-color:#ccc;
        margin:0 10px;
     }
    .container h1 {
        margin:0 0 10px 0;
        font-size:1em;
     }
    .container input {
        margin-bottom:10px;
     }
    </style>
    
    <script type="text/javascript">
    
    function init() {
    
       var kywd=['','KEYWORD/'];
       var df=[];
       f=document.getElementsByTagName('form');
    for(c=0;c<f.length;c++) {
       df[c]=document.forms[c];
       df[c].number=c;
       df[c].onsubmit=function() {  
       location.href='https://secure.domain.com/'+kywd[this.number]+df[this.number][0].value;
       return false;
       }
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    
    </script>
    
    </head>
    <body>
    
    <div id="wrapper">
    
    <form action="#">
    <div class="container">
    <h1>enter your code</h1>
    <input type="text">
    <input type="submit">
    </div>
    </form>
    
    <form action="#">
    <div class="container">
    <h1>enter your code</h1>
    <input type="text">
    <input type="submit">
    </div>
    </form>
    
    </div>
    
    </body>
    </html>
    
    ... but more than one form will require individual submissions though.

    You can have any number of forms, just add extra keywords to the kywd array.

  3. #63
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    coothead,

    I was wondering if you could update the original code you gave me in post #46 of this thread so that a page automatically displays in the iframe when the page first loads. I tried removing "display:block" and the class="hide" and adding a src="LINK" to the <iframe id="myframe"... code, but it's still blocked. Is there something I can replace "block" and "hide" with that will allow the "src" page to show up?

  4. #64
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: open url from text box? pls help

    Hi there lasko,

    try it like this...
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>untitled document</title>
    
    <style type="text/css">
    body {
        background-color:#f0f0f0;
     }
    form {
        text-align:center
     }
    form input {
        width:300px;
     }
    #myframe {
        display:block;
        width:800px;
        height:400px;
        border:1px solid #999;
        margin:20px auto 0;
        box-shadow:#666 4px 4px 16px;
     }
    </style>
    
    <script type="text/javascript">
       var df,obj;
    function init() {
    
       df=document.forms[0];
       df[0].value='http://';
       df.onsubmit=function(){
       return false;
     }
       obj=document.getElementById('myframe');
    
       window.addEventListener?
       document.body.addEventListener('keyup',gothere,false):
       document.body.attachEvent('onkeyup',gothere);
     }
    
    function gothere(event) {
    
    if((!navigator.language)&&(event.keyCode==13)) {
       obj.src=df[0].value;
       obj.className='';
       return false;
     } 
    else {
    if(event.which==13) {
       obj.src=df[0].value;
       obj.className='';
       return false;
       }
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    
    </script>
    
    </head>
    <body>
    
    <form action="#">
     <div>
      <input type="text" value="http://">
     </div>
    </form>
    
    <div>
     <iframe id="myframe" src="http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=6028&amp;page=7" frameborder="0" scrolling="auto"></iframe>
    </div>
    
    </body>
    </html>
    

  5. #65
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    It works perfectly except now the main domain is visible in the input field. The input field used to load empty (hiding the main domain that the inputs would load in the iframe off of) and when someone wrote "WORD" in it, it would load http://www.whateverdomainichose.com/WORD in the iframe. Now, you have to leave the entire domain in the input field and manually insert the "WORD" after it for the proper page to load in the iframe. I hope that made sense.

    Is there any way to achieve both or is it one or the other?

    Thanks for your help, coothead.

  6. #66
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    Nevermind! The code works perfectly. The problem was on my end (I had to reinstall a patch for my web publishing program that somehow got messed up). The problem is fixed.

    Thanks a lot for your help, coothead.

  7. #67
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: open url from text box? pls help

    No problem, you're very welcome.

  8. #68
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    coothead,

    Is there any way to add a feature to this input box (code below) that creates a list of suggestions underneath when someone types into it? Something similar to the search boxes on websites like Amazon? I'd like to list all the keywords in the code and when someone types "A" for instance, the keywords that start with "A" are listed underneath and can be clicked, autofilling the input field. Can this be done easily or would it require extensive coding?

    Thanks.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>untitled document</title>
    
    <style type="text/css">
    body {
        background-color:#f0f0f0;
     }
    form {
        text-align:center
     }
    form input {
        width:300px;
     }
    #myframe {
        display:block;
        width:800px;
        height:400px;
        border:1px solid #999;
        margin:20px auto 0;
        box-shadow:#666 4px 4px 16px;
     }
    </style>
    
    <script type="text/javascript">
       var df,obj;
    function init() {
    
       df=document.forms[0];
       df[0].value='http://';
       df.onsubmit=function(){
       return false;
     }
       obj=document.getElementById('myframe');
    
       window.addEventListener?
       document.body.addEventListener('keyup',gothere,false):
       document.body.attachEvent('onkeyup',gothere);
     }
    
    function gothere(event) {
    
    if((!navigator.language)&&(event.keyCode==13)) {
       obj.src=df[0].value;
       obj.className='';
       return false;
     } 
    else {
    if(event.which==13) {
       obj.src=df[0].value;
       obj.className='';
       return false;
       }
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    
    </script>
    
    </head>
    <body>
    
    <form action="#">
     <div>
      <input type="text" value="http://">
     </div>
    </form>
    
    <div>
     <iframe id="myframe" src="http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=6028&amp;page=7" frameborder="0" scrolling="auto"></iframe>
    </div>
    
    </body>
    </html>
    

  9. #69
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    I searched around some and found out the script I'm looking for is called JQuery Autocomplete. It looks fairly easy to insert in the existing script you've provided me, so I'll see. But, thanks anyway, coothead.

  10. #70
    yoursitessuccess's Avatar
    New User

    Status
    Offline
    Join Date
    May 2012
    Location
    Queensland
    Posts
    8

    Re: open url from text box? pls help

    since your on a roll coothead...
    I read every page of this post. I'm using a code you put on another post, it's similar to the frame code you put on page 2 of this post.
    The one I am using adds the text submitted to the end of the url, what I want to be able to do is add it to several urls like in the frame one you put but I want them to open in new pages not in frames.
    Is this possible?



Page 5 of 5 First 1 2 3 4 5

Tags for this Thread