Results 1 to 7 of 7

Thread: DHTML Modal window

  1. #1
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Modal window

    1) Script Title: DHTML Modal window

    2) Script URL (on DD): DHTML Modal window

    3) Describe problem: Is it possible to use it from a form action like this?

    Code:
    <form action="" method="post" onsubmit="">
    <input type="text" name="productID" value="" size="20" maxlength="30">
    <input name="image" type="image" src="../images/searchbutton.gif" alt="Search" onsubmit="productSearch('http://www.mydomain.com/searchresult.php'); return false"> 
    </form>
    I want to use a form to search for a product and the result should popup in DHTML Modal window.
    Last edited by Jet-li; 06-05-2007 at 02:34 PM.

  2. #2
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is how i want to have the code. But it don't like to open the window at all so something must be wrong with it......

    Code:
    <script type="text/javascript">
    function productSearch(url){
    var productSearchwin=dhtmlmodal.open("productSearchbox", "iframe", url, "product search result", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
    
    }
    </script>
    
    <h3>Enter product Name:</h3>
    <form name="product">
        <input name="productID" type="text"/> 
    	<input name="image" type="image" src="../images/searchbutton.gif" alt="Search" onsubmit="performerSearch('product.php')"/>
    </form>

  3. #3
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I maybe wrong on this, but I believe onsubmit is used in the form tag. Try changing onsubmit to onclick.

  4. #4
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It was make some improvmets but now i got the problem how to get the productID into the iframe. Like it is now it load the iframe and close it, and this i think it's because the productID goes into the mainpage and not into the iframe......

  5. #5
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <script type="text/javascript">
    function productSearch(url){
    var productSearchwin=dhtmlmodal.open("productSearchbox", "iframe", url, "product search result", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
    
    }
    </script>
    
    <h3>Enter product Name:</h3>
    <form name="product">
        <input name="productID" type="text"/> 
    	<input name="image" type="image" src="../images/searchbutton.gif" alt="Search" onClick="performerSearch('product.php'); return false"/>
    </form>
    did ad code in red i was missing and the ifram popup like it should.Now the only problem is to get text value into the iframe....

  6. #6
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <script type="text/javascript">
    
    function productSearch(url) {
        var myForm=document.Product
        var myValue=myForm.productID.value
    
        if (myValue!="") {
           productSearchwin=dhtmlmodal.open("productSearchbox", "iframe", url + myValue, "product search result", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
        } else {
            alert("Please enter value.")
        }
    
    }
    </script>
    
    <h3>Enter Product Name:</h3>
    <form name="Product" method="post">
        <input name="productID" type="text"/> 
    	<input name="image" type="image" src="../images/searchbutton.gif" alt="Search" onClick="productSearch('product.php?');  return false"/>
    </form>
    Now i got it to work My first attempt with javascript and it's ending with succes

  7. #7
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi jet li,

    i have the same problem with you. i am trying to post form values onto an email.asp page via contact form. i tried what you coded but it failed. i thisnk it is about onsubmit command. ( how can i do it??

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
  •