Forum Moderators: open
<form action="popup.asp" target=new method="post"
<input type="hidden" name="item" value="item">
</form>
The popup.asp page loads as expected and passes the variable, so the fundamentals are working just fine. However, I'd like to further customize the popup.asp window so that it's a bare-bones window (i.e., no toolbars, menubars, etc.). I'm told such customization must be done via javascript within the requesting page. I've seen one example where the programmer used the onsubmit event within the form to specify the popup window properties. Unfortunately, this only creates two popups when I tried it. Can anyone set me straight here? I just want one popup without all the extra stuff.
Best Regards,
B
I added return false to the onsubmit function call, as shown below, and that prevented the duplicate browser. Unfortunately, it eliminated the browser I expected from the action attribute, which is where the hidden variables are being passed:
<form action="popup.asp" target="_blank" method="post"
onsubmit="window.open('popup.asp','','menubar=no,toolbar=no'); return false">
<input type="hidden" name="item" value="item">
</form>
As a result, popup.asp appears in a window without menu or toolbars (good), but that page isn't receiving the hidden form value that I need to pass to it (bad). Basically, I need to use the action attribute to pass the hidden variable to popup.asp while retaining the ability to customize the window properties.
Rambo Tribble,
I tried setting the action attribute to the sample you provided, but that also prevents the passing of the hidden variable.
If either of you have any other ideas, I'd be eternally grateful.
B
<script type="text/javascript">
function submitmyform(f) {
f.target = 'foo';
window.open('',f.target,'menubar=no,scrollbars=no,width=300,height=200');
f.submit();
return false;
}
</script>
[..]
<form action="popup.asp" target="_blank" onsubmit="return submitmyform(this);">
[..]
That should be it!
Got it...thanks again.
Rambo,
Do you mean change the target value to _blank within the function, or in the <form> tag on the requesting page? I've still got it in the requesting page as follows:
<form action="popup.asp" target="_blank" method="post" onsubmit="return submitmyform(this);">
Is the target doing anything in the <form> tag if it's already specified as "foo" within the function?
Forums Forever
B