/    Sign up×
Community /Pin to ProfileBookmark

Submit a form to a popup w/ a certain size

I want to submit a form on a page that when the submit button is clicked, it will open up a new page with a specified size that the information is submitted to the new opened window.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@pyroOct 09.2003 — <form action="yourpage.php" method="post" target="_blank">

and then on yourpage.php, use [URL=http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1203300]resizeTo[/URL] to resize the window.
Copy linkTweet thisAlerts:
@redbrad0authorOct 09.2003 — Thanks pyro, but I guess I do not understand how resizeTo works and the page you linked me to didn't make it clear. Would doing this cause problems with browsers that block popups?
Copy linkTweet thisAlerts:
@VladdyOct 09.2003 — [i]Originally posted by redbrad0 [/i]

[B]Thanks pyro, but I guess I do not understand how resizeTo works and the page you linked me to didn't make it clear. Would doing this cause problems with browsers that block popups? [/B][/QUOTE]

Browsers that block popups also have an option to prevent javascripts that manipulate window size and location from doing so. Your best bet is to design so that your site stays within a window which size and position is determined by device and user preference.
Copy linkTweet thisAlerts:
@TomDenverOct 09.2003 — Using resizeTo:

[code=php]<body onload="resizeTo(width, height);">[/code]

I think some of the better pop up blockers will allow pop ups that you request, but block ones that you don't request (like the ones that pop up with onUnload and other annoying stuff). Google's toolbar has a great pop up blocker, but I believe it's only available for IE for now. It's free if you want to try it out.

You can also use resizeTo in the function that calls the pop up, instead of in the body tag of the window. If you're going to use resizeTo on a pop up, you may also want to use moveTo(x, y) as well to set where you want the pop up to appear. X is the offset from left of screen, and y is the offset from the top, both in pixels.
×

Success!

Help @redbrad0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...