42 users online (0 members and 42 guests)  


Page 4 of 5 First 1 2 3 4 5 Last
  Results 46 to 60 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. #46
    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,

    and a warm welcome to these forums.

    Try this code, which has been tested in IE8, Firefox 3.6.17, Opera 11.1 and Safari 5.33...
    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">
    
    form {
        text-align:center
     }
    form input {
        width:300px;
     }
    #myframe {
        display:block;
        width:760px;
        height:570px;
        margin:20px auto 0;
     }
    .hide {
        visibility:hidden;
     }
    </style>
    
    <script type="text/javascript">
       var df,obj;
    function init() {
    
       df=document.forms[0];
       df[0].value='http://';
       df[0].focus();
       df.onsubmit=function(){
       return false;
     }
       obj=document.getElementById('myframe');
       obj.src='';
    
       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" class='hide'  scrolling="auto"></iframe>
    </div>
    
    </body>
    </html>
    

  2. #47
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    WOW! Thank you, it works perfectly. One thing, there's no "OK" (or GO) button anymore. Is there a way to add it back in (as a button or an image, I don't care) without messing up the ability to pull up the page by just pressing enter? I tried adding this:

    <input type="button" value="GO">

    but the button that appeared was the exact length of the form input (way too long).

    Thanks.

  3. #48
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    Nevermind. I added:

    style="width: 100px"

    after

    <input type="button"

    and it added the button back and allowed me to customize the size.

    Thanks, coothead.

  4. #49
    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,

    I am sorry about that.

    I misread your post and thought that you did not want a submit button.

    Here is the amended code which includes a button...
    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:#ccf;
     }
    form {
        width:455px;
        margin:20px auto;
        overflow:hidden;
     }
    form input { 
        float:left;
        width:300px;
        margin:10px 5px 0 0;
     }
    form #button {
        float:left;
        width:140px;
        height:40px;
        line-height:40px;
        border:0;
        margin:0; 
        background-image:url(http://www.coothead.co.uk/images/but.gif);
        font-size:16px;
        font-weight:bold;
        color:#fff;
        text-align:center;
        cursor:pointer;
     }
    #myframe {
        clear:both;
        display:block;
        width:760px;
        height:570px;
        margin:20px auto 0;
     }
    .hide {
        visibility:hidden;
     }
    </style>
    
    <script type="text/javascript">
       var df,obj;
    function init() {
    
       df=document.forms[0];
       df[0].value='http://';
       df[0].focus();
    df.onsubmit=function(){
       return gothere();
     }
       obj=document.getElementById('myframe');
       obj.src='';
    
       window.addEventListener?
       document.body.addEventListener('keyup',checkkey,false):
       document.body.attachEvent('onkeyup',checkkey);
     }
    
    function checkkey(event) {
    
    if((!navigator.language)&&(event.keyCode==13)) {
       return gothere();
     } 
    else {
    if(event.which==13) {
       return gothere();
       }
      }
     }
    function gothere() {
       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://">
      <input id="button" type="submit" value="go there">
     </div>
    </form>
    
    <div>
     <iframe id="myframe" class='hide'  scrolling="auto"></iframe>
    </div>
    
    </body>
    </html>
    
    Last edited by coothead; 06-25-2011 at 02:53 PM.

  5. #50
    bradylars's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2011
    Posts
    3

    Re: open url from text box? pls help

    Any body have any suggestions to my problem I posted above a few months back? Any changes i should try making? I'd really appreciate some help here..

  6. #51
    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 bradylars,

    and a warm welcome to these forums.

    Sorry, but I somehow missed your earlier post.

    You should really have started a new thread with it though,
    as there is much less chance of it being overlooked.

    I ran your page through the validator and it showed various errors...

    On rectifying them and generally tidying up your code, the
    page now works OK in IE8, which was the only browser that
    choked on the code.

    So replace your page with this...
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <!-- this is for coothead testing and may be removed -->
    <base href="http://www.1photo.com/">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>1Photo.com - Taylor Made Images - Totshots Photography</title>
    
    <style type="text/css">
    body {
        margin:0;
        background-color:#000;
     }
    #Table_01 {
        width:900px;
        height:800px;
        margin:auto
     }
    img {
        border:0;
     }
    .style1 {
        font-family:geneva,arial,helvetica,sans-serif;
        font-size:12px;
        color:#999;
    }
    </style>
    
    <script src="scripts/shadowbox3b/shadowbox.js" type="text/javascript"></script>
    <script src="scripts/shadowbox3b/shadowbox_init.js" type="text/javascript"></script>
    <link href="scripts/shadowbox3b/shadowbox.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
    
    // BeginWebWidget Shadowbox3b
    
    function shadowbox3b_1(){
    // This shadowbox class shows the most common available options. You may delete all options that are unused.
    // See http://www.shadowbox-js.com/usage.html for explainations and the Options page for all avalable options.
    // Also, if you add or remove options from this list, make sure there is no comma after the final option.
    Shadowbox.open({
       content: 'http://downloads.1photo.com/', //The actual content to display (e.g. URL, HTML code, etc.)
       player: "iframe", //The player that should be used for the type of content. Option are: "img", "swf", "flv", "qt", "wmp", "iframe", "html"
       title: "Downloads", //The title to use for the content (optional)
       height: 350, //The content's height (in pixels, optional for images)
       width: 400, //The content's width (in pixels, optional for images)
      });
     };
    	
    // EndWebWidget Shadowbox3b
    </script>
    
    </head>
    <body>
    
    <!-- ImageReady Slices (selection.psd) -->
    <table cellpadding="0" cellspacing="0" id="Table_01"><tr>
    <td colspan="5"><img src="images/index_01.jpg" width="900" height="59" alt=""></td>
    </tr><tr>
    <td height="34" colspan="5" style="background-image:url(images/index_02.jpg)">
    <div align="center" class="style1">Welcome to 1photo.com, Taylor Made Images and TotShots Photography</div></td>
    </tr><tr>
    <td colspan="5"><img src="images/index_03.jpg" width="900" height="51" alt=""></td>
    </tr><tr>
    <td><img src="images/index_04.jpg" width="40" height="185" alt=""></td>
    <td><a href="http://1photo.morephotos.com/mp_client/pictures.asp"><img src="images/index_05.jpg" width="246" height="185" alt=""></a></td>
    <td><a href="http://taylormadeimages.1photo.com"><img src="images/index_06.jpg" width="286" height="185" alt=""></a></td>
    <td><a href="http://totshots.1photo.com"><img src="images/index_07.jpg" width="284" height="185" alt=""></a></td>
    <td><img src="images/index_08.jpg" width="44" height="185" alt=""></td>
    </tr><tr>
    <td><img src="images/index_09.jpg" width="40" height="68" alt=""></td>
    <td valign="top"><div align="center"><span class="style1">Click Here to view photos </span></div></td>
    <td valign="top"><div align="center"><span class="style1">Highschool, Junior High, Elementary Schools<br>
    Highschool and Junior High sports<br>
    Special Events Photography</span></div></td>
    <td valign="top"><div align="center"><span class="style1">Preschool and Recreation Photography</span></div></td>
    <td><img src="images/index_13.jpg" width="44" height="68" alt=""></td>
    </tr><tr>
    <td>&nbsp;</td>
    <td colspan="3" valign="top"><table width="796" align="center" cellpadding="0"><tr>
    <td width="200"><a id="shadowbox3b_1" onclick="shadowbox3b_1();return false" href="#"><img src="images/download.jpg" width="200" height="107" alt=""></a></td>
    <td width="509" class="style1">If you've ordered a digital photo click here to download it.</td>
    </tr> <tr>
    <td>&nbsp;</td>
    <td class="style1">&nbsp;</td>
    </tr><tr>
    <td>&nbsp;</td>
    <td class="style1">&nbsp;</td>
    </tr></table></td>
    <td>&nbsp;</td>
    </tr><tr>
    <td height="138" colspan="5" valign="bottom" style="background-image:url(images/index_14.jpg)">
    <div align="center"><span class="style1">801.399.0811 -  3370 S. 1500 W Ogden, Utah 84401</span></div></td>
    </tr><tr>
    <td colspan="5"><img src="images/index_15.jpg" width="900" height="141" alt=""></td>
    </tr><tr>
    <td colspan="5"><img src="images/index_16.jpg" width="900" height="124" alt=""></td>
    </tr></table>
    <!-- End ImageReady Slices -->
    
    </body>
    </html>
    

  7. #52
    bradylars's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2011
    Posts
    3

    Re: open url from text box? pls help

    Coothead, thanks so much for combing through my mess for me. I really appreciate it.

  8. #53
    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.

  9. #54
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    coothead,

    I think I'm using the code you provided in post #46 of this thread and I had a question. Ok, typing a "keyword" in the box causes a page to load in the frame that comes up. That works fine. But if I have a link on the page that loaded in the frame and you click it, it doesn't load in the frame, but instead, breaks out of the frame and loads in the whole window. I was wondering, what should I put in between the quotes: TARGET="HERE" in my standard <A HERF link codes so that when clicked, they'll load the page IN the frame and not break out of it?

    Thanks.

  10. #55
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    Nevermind. I searched Microsoft's website for examples of target values and "_self" (a target value I had never even heard of) seems to do the trick.

  11. #56
    jacknotman's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2011
    Posts
    1

    Question Re: open url from text box? pls help

    Hey, I was wondering if anyone could help me with a search field (search box and go button) that the user can search a word and it goes to a page anchor associated with that word. As I'm a html beginner a walk through would be much appreciated. Thanks Jack

  12. #57
    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 alter the code in post #11 so that it works by hitting enter on your keyboard instead of using an "OK" button.

    Thanks.

  13. #58
    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//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">
    #container {
        width:195px;
        border:3px double #000;
        padding:10px;
        font-family:sans-serif;
        color:#000;
        text-align:center;
        background-color:#ccc;
        margin:auto;
     }
    #container h1 {
        margin:0 0 10px 0;
        font-size:1em;
     }
    </style>
    
    <script type="text/javascript">
    
    function init() {
    
       df=document.forms[0];
       df[0].focus(); 
    
       df.onsubmit=function() {  
       location.href='https://secure.domain.com/'+df[0].value;
       return false;
      }
     }
    
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    
    </script>
    
    </head>
    <body>
    
    <form action="#">
    <div id="container">
    <h1>enter your code</h1>
    <input type="text">
    </div>
    </form>
    
    </body>
    </html>
    

  14. #59
    lasko's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    16

    Re: open url from text box? pls help

    Thank you, coothead! It works perfectly.

    The two codes you've given me have become integral parts of my upcoming website and have made it better than I ever thought it could be.

    I embedded the message "Original unedited code for [what I use them for] provided by coothead from the Advanced HTML For Beginners forums" in my website's HTML code. Is that ok? Or would you rather it be worded differently, say something more or say something else entirely?

    Thanks again.

  15. #60
    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,

    It's always a pleasure to help members with their coding problems.

    The code that I write is, of course, free for anyone to use with
    no strings attached.

    Any message, though, referring to AFHB2000.com or yours
    truly, will always be gracefully received.



Page 4 of 5 First 1 2 3 4 5 Last

Tags for this Thread