[Help] Unable to modify my script according to my requirement !

Discussion in 'JavaScript' started by i'm, Sep 5, 2010.

  1. #1
    Hell Everyone,

    I have made a script like this

    <head>
    <Script Language=Javascript>
    
    function reloadframe() {
    
    var iframe = document.getElementById('gframe');
    iframe.src = 'http://www.myblog.com/search?=' + document.searchForm.search.value.replace(/ /g,'+') + '=true';
    
    }
    </Script>
    </head>
    
    <body>
    
    <form name="searchForm">
    <center>
    <img src="images/search.png" align ="absmiddle" />
    <input type="text" name="search" style="padding:5px; border:5px solid #ddd;font:18px arial,sans-serif bold;width:325px;height:30px;"/>
    <img align="absmiddle" src="images/Normal.png" onmouseover="this.src='images/Hover.png';" onmouseout="this.src='images/Normal.png';" 'onclick="javascript:reloadframe()"' />
    </center>
    <p>
    
    <iframe id="gframe" width="990px" height="250px" src="http://myblog.com/"></iframe>
    
    
    </body>
    Code (markup):
    If you see the current code what it does is after you press the search button it changes the frame source and hence it displays a different frame

    I have 2 problems in this script.It does not work on IE and the other problem is how do i modify it into this :

    So how do i make it in such a way that when the user clicks on Search,it should go to a new page like this

    http://mybog.com/search.php=ENTERED+TEXT.

    And in this page he should find my frame that is "gframe".

    Any ideas on how to code this ?

    Thanking You,
    I'm
     
    i'm, Sep 5, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try removing the single quotes around onclick="javascript:reloadframe()"
     
    Cash Nebula, Sep 6, 2010 IP
  3. i'm

    i'm Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Any ideas anyone ??
     
    i'm, Sep 14, 2010 IP