Announcement

Collapse
No announcement yet.

Have a little bit of a mystery with a JavaScript "alert box"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Have a little bit of a mystery with a JavaScript "alert box"

    Hi all,

    I'm trying to create an addition to Listing (product) templates with "This item will usually ship within X business days".

    Then there would be a "?" (question mark) picture that when clicked would pop-up a box explaining that larger orders may require additional production time, and to contact us for a delivery date based on an order size.

    I have it coded as follows:

    <div align="center" style="color:rgb(0,0,0);">This item usually leaves our warehouse in 1-2 business days.<script>
    function myFunction()
    {
    alert("This is the typical lead time before an item ships. Larger orders may have an additional production time. \n\nHave a specific due date? Contact us and we will check the production and delivery time.\n\n555-555-555 or [email protected]");
    }
    </script>

    <input type="image" src="assets/images/default/Blue_Question.jpg" onclick="myFunction()" value="Show alert box" /></div>


    It works great! EXCEPT, when you close the pop-up box (by clicking "OK") it -- for whatever reason -- redirects you to the View_Cart.asp page rather than keeping you on the same page.

    Anyone know how to keep it on the same page when the box is closed? Or a different route that I could take with the code?

    Thanks in advance!
    -James
    Last edited by JR123; 11-20-2012, 04:02 PM.

  • #2
    Never mind I think I figured it out!

    Comment

    Working...
    X