I had designed an HTML form with submit button. But instead of submit it to another page I want to submit to pop up windows where I can limit the size of the pop up windows say ‘320×240’ hide all the toolbar, disable resize.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s my go at it; this JavaScript snippet should go into the head of your page:
And this is a sample form for demonstration purposes:
Now, here’s what’s happening: first, we set up a form and give it an
onsubmitattribute that tells it to run the functionprocess()andreturn false;instead of submitting normally; from this point, that function takes over and creates a popup window, giving it a name, and some features (by all means, add any surplus ones you’d like), and then attention comes back to the form, where we now set thetargetattribute to the name of the window we just created.We then have to clear that
onsubmitthat we set earlier, or this same exact thing will happen again, and that’s certainly not what you want. Finally, we just have the form submitted again and it now passes all of its information to the popped window; from there, it’s just gettinghandle.html(or whatever you end up calling your processing page) to do its work with the data.Hope I’ve helped.