Results 1 to 7 of 7

Thread: How to open searchresults in DHTML Window widget

  1. #1
    Join Date
    Jan 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to open searchresults in DHTML Window widget

    1) Script Title: DHTML Window widget (v1.1)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

    3) Describe problem: Open searchresults in Window widget.

    First of all i am bad in english writing, but i want to have some help with this script.
    It works good, but i want to open search results in that Window widget.

    What do i have to change in this form to open search results in the widget?

    <form id="searchForm" action # name="searchForm" onsubmit="chooseSearch(); return false;" method="post">

    <script>
    function chooseSearch(){
    s = document.searchForm.engine.options[document.searchForm.engine.selectedIndex].value + document.searchForm.keywords.value
    location = s
    }
    </script>

    <input onfocus=" this.value=''" value="Searching for..." name="keywords" size="21"/> <select style="font-family: Verdana; font-size: 10pt; font-weight:" name="engine" size="1">


    <option value="http://www.google.nl/search?q="/>Google
    <option value=" http://www.google.nl/blogsearch?hl=nl&q="/>Google Blog
    <option value="http://images.google.nl/images?hl=en&q="/>Google Afbeeldingen
    <option value="#"/>
    </select>

    <input class="button" value="Search" name="Button" onclick="chooseSearch()" type="button"/>


    </form>


    Thanks!

  2. #2
    Join Date
    Jan 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Anybody? It would be a great help thanks

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You can get a form to target its results to appear in a DHTML window, yes. See this thread: http://www.dynamicdrive.com/forums/s...ad.php?t=19083

  4. #4
    Join Date
    Jan 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    @ddadmin, thanks for the reply.

    I looked to the link you give me,

    but i don`t now how to change the form i give above.

    I don`t understand the iframe thing, sorry for the don't understanding but i'm just a html beginner.



    Please help me to change the above form.
    Last edited by RvdH; 01-08-2008 at 02:43 PM.

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    In your form, you don't need to change anything from the default other than to add a target attribute inside the <FORM> tag:

    Code:
    <form target="_iframe-googlebox" action="http://www.mysite.com/submit.php">
    
    <input type="submit" />
    
    </form>
    This is assuming the DHTML window to contain the returned form results is already open on your page, by calling something like:

    Code:
    <script type="text/javascript">
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "about:blank", "Form results", "width=590px,height=350px", "recal")
    </script>
    on your page. Or are you looking to only open a DHTML window on demand, when the form is actually submitted?

  6. #6
    Join Date
    Jan 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    @ddadmin, thanks but:

    Or are you looking to only open a DHTML window on demand, when the form is actually submitted?
    Thats exactly what i want!

    I am sorry to bother you, i only want to open a dhtml window when somebody is searching for something.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sure, you can have the DHTML window that contains your form results only open when the form is actually submitted by putting the code that opens a DHTML window in a function, and calling it via the onSubmit event of forms. So for example:

    Code:
    <script type="text/javascript">
    
    function loadform(){
    formwindow=dhtmlwindow.open("formbox", "iframe", "about:blank", "Form results", "width=590px,height=350px,resize=1,scrolling=1,center=1")
    }
    
    </script>
    
    <form target="_iframe-formbox" action="http://www.mysite.com/submit.php" onSubmit="loadform()">
    
    <input type="submit" />
    
    </form>

Bookmarks

Posting Permissions

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