Portal   Forum   Members   Market   Gallery   Events

Javascripting Question

Discussion in 'Help Forum' started by Gilgamesh, Feb 10, 2006.

  1. Gilgamesh

    Gilgamesh MSC Footman

    Jun 17, 2000
    Likes Received:
    Market Rating:
    A friend of mine has come across a javascripting issue that he can't figure out... anyone here know the solution to the question below:

    So I'm not the most proficient at javascript, I use it mainly for
    form checking and the odd onclick or onload instruction. What i'm
    trying to do is this:

    Use an image map link to pass the current page's URL on to the next
    page for use in a form. The linked page needs to be opened in a new
    window. In the code below I have wrapped a form around my image map
    so the third clickable area shape submits the form and passes the
    current URL on to the next page.

    <form action="/forms/tellafriend_new.php" method="post"
    name="passurl" target="_blank" id="passurl">
    <input name="url" type="hidden" id="url">
    <SCRIPT LANGUAGE="javascript">
    var url = window.location
    document.passurl.url.value = url
    <map name="Map">
    <area shape="rect" coords="294,28,465,49" href="#"
    ht=320,width=400');return false;">
    <area shape="rect" coords="488,28,584,49" href="javascript:print()">
    <area shape="rect" coords="608,28,695,49" href="#"

    What I really want to do is make that third area shape not only
    submit the form, but also load the form action page (/forms/
    tellafriend_new.php) into a new window, similar to what is being done
    with the first area shape for the news_popup content.

    Is there a way to combine the form submission with opening a new
    window of a certain shape and size? I've tried adding
    "target='blank'" to the form action and that does open a new window
    in which i can put onload=resizeTo(x,y) in the body tag, but that
    leaves all the scroll bars and browser window interface intact which
    is undesirable!
  2. Jakeman

    Jakeman MSC Founder and Donator

    Feb 26, 2000
    Likes Received:
    Market Rating:
    Has he tried just adding the additional javascript to the onclick action? I have never tried it.

Hitometer: 55,894,195 since 1995