Could someone help this total Javascript newbie? I’m trying to do something that appears very simple but in actuality is hurting my brain.
When a user clicks on a specific image map area I want that to open a new window without scrollbars or status bar etc. and it also needs to pass the original page’s URL on to the new popup window for use in a second form. I was trying to use onClick for this but I can’t figure out how to combine opening a new window with passing the URL just using onClick.
In my testing code below I’ve put in a tiny bit of JS to grab the URL and put it into a form variable. Clicking on the first image map area submits the form and opens the resulting page into the original window just fine. Clicking on the second image map opens the new window as desired, but I don’t know how to pass a form variable along with defining the popup window all at once. What direction should I take to make this work? Thanks!
[CODE]<form action=”/popup_form.html” 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
</SCRIPT>
<map name=”Map”>
<area shape=”rect” coords=”608,28,695,49″ href=”#” onClick=”document.passurl.submit()”>
<area shape=”rect” coords=”294,28,465,49″ href=”#” onClick=”PopUp=window.open(‘/popup_form.html’,’Popup’,’scrollbars=no,status=no,resizable=yes,height=320,width=400′);return false;”>
</map>
</form>