Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2005, 06:52 AM
Authorized User
 
Join Date: Nov 2005
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing data to javascript pop up

Hay people, just signed up, dont know why i dident do it eariler, looking forward to using this great resource

Quick question 1:

I have a form, one text box, on hitting submit or enter i want it to pop up a new window, passing the textbox data to that page in the window.

2 ways i know of, POST and querrystring, dont mind what i use, just dont know how, have the window opening with javascript:window.open('page',..... but dont know how to get the form data to the page?

Quick question 2:

I have a login page in a popup, if the user logs in it resizes the popup, i would also like to add scrollbars on the resize, but the page dosent have them to begin with, so is there a way to add scrollbars to a page when the page is already open?

thanks for any help!
Reply With Quote
  #2 (permalink)  
Old November 29th, 2005, 07:56 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Whether you use GET or POST is governed by the method attribute of your <form>.

I assume you are using javascript because you want to control window size etc, otherwise you could just add target="_blank" to your <form>

You could create a new window and then set the form's target to the new window...
Code:
function DoSubmit(form){
    var winName = form.name + "_win";
    window.open("", winName, "scrollbars=no");    
    form.target = winName;
    form.submit();
}
...

<form name="myForm" action="wrox.asp" onsubmit="DoSubmit(this);">
    <input type="hidden" name="myHidden" value="myHiddenValue">
    <input type="submit">
</form>
AFAIK you cannot change the scrollbars setting on a window after it has been opened. You could create a div that fills the entire page with it's style overflow attribute set to auto for a similar effect.

HTH,

Chris

Reply With Quote
  #3 (permalink)  
Old November 29th, 2005, 10:38 AM
Authorized User
 
Join Date: Nov 2005
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perfect, thanks for ya help Chris

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data from PHP to Javascript oldBroh Javascript How-To 12 June 12th, 2008 11:12 PM
Passing data from PHP to Javascript youngj PHP How-To 4 February 22nd, 2006 11:55 PM
Passing value across iframe and pop-up window muklee Javascript 1 October 28th, 2004 04:44 PM
passing data btwn asp page and javascript include Justine Classic ASP Professional 8 August 20th, 2004 02:23 AM



All times are GMT -4. The time now is 01:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.