473,217 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,217 software developers and data experts.

Passing text to a new window

Hi whats the easiest way to pass text from one page to another.

I have a form on one page that has a textbox and "go" button.
when the user selects Go, i would like it to go to another window
with the text he/she already inputed filled in the textbox.

Aug 7 '06 #1
4 1261
Br**************@gmail.com wrote:
Hi whats the easiest way to pass text from one page to another.

I have a form on one page that has a textbox and "go" button.
when the user selects Go, i would like it to go to another window
with the text he/she already inputed filled in the textbox.
Try it for another page in your own domain first, then it will be easy
to see that you can't do it for someone else's site.

Aug 7 '06 #2
Br**************@gmail.com wrote:
Hi whats the easiest way to pass text from one page to another.

I have a form on one page that has a textbox and "go" button.
when the user selects Go, i would like it to go to another window
with the text he/she already inputed filled in the textbox.
Hi,

The easiest way is to use a serverside language, like PHP.
If that is no option, just pass the text to the next page using the URL.

From your first page:
<form action="nextpage.html" METHOD="GET">
<input type="text" name="yourname">
<input type="button" value="go">
</form>

If somebody filled in "Joe Jackson", the URL will contain:
nextpage.html?yourname=Joe%20Jackson

From nextpage.html
<script type="text/javascript">
// get the passed value for yourname
var query = location.search.substring(1);
// query now contains yourname=Joe%20Jackson
// now do basic stringmanipulation to retrieve the actual name.

</script>
Regards,
Erwin Moller
Aug 7 '06 #3
Thanks Erwin,
thats great. thanks i thought that was the simplest.

do you know an even simpler way.
can you do it simple like this line
javascript:void(document.body.style.backgroundColo r='#c00')
Hi,

The easiest way is to use a serverside language, like PHP.
If that is no option, just pass the text to the next page using the URL.

From your first page:
<form action="nextpage.html" METHOD="GET">
<input type="text" name="yourname">
<input type="button" value="go">
</form>

If somebody filled in "Joe Jackson", the URL will contain:
nextpage.html?yourname=Joe%20Jackson

From nextpage.html
<script type="text/javascript">
// get the passed value for yourname
var query = location.search.substring(1);
// query now contains yourname=Joe%20Jackson
// now do basic stringmanipulation to retrieve the actual name.

</script>
Regards,
Erwin Moller
Aug 7 '06 #4
Br**************@gmail.com wrote:
Thanks Erwin,
thats great. thanks i thought that was the simplest.

do you know an even simpler way.
can you do it simple like this line
javascript:void(document.body.style.backgroundColo r='#c00')
Well yes.
If you have already 2 windows, you can use Javascript to communicate
directly (assuming the 2 windows are in the same domain).

eg from mainpage:
var myNewWindowRef = window.open(..etc..);

// call a function in new window:
myNewWindowRef.document.setName("John");

The last call tries to pass the string "John" directly to a function named
setName in the new window.
(Pay attention however that the second window must be fully loaded first
before the Javascriptfunctions become available, otherwise you'll get an
error of course because the function doesn't exist.)

Regards,
Erwin Moller

>
>Hi,

The easiest way is to use a serverside language, like PHP.
If that is no option, just pass the text to the next page using the URL.

From your first page:
<form action="nextpage.html" METHOD="GET">
<input type="text" name="yourname">
<input type="button" value="go">
</form>

If somebody filled in "Joe Jackson", the URL will contain:
nextpage.html?yourname=Joe%20Jackson

From nextpage.html
<script type="text/javascript">
// get the passed value for yourname
var query = location.search.substring(1);
// query now contains yourname=Joe%20Jackson
// now do basic stringmanipulation to retrieve the actual name.

</script>
Regards,
Erwin Moller
Aug 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wade Wegner | last post by:
Hello, I have been desperately trying to programmatically authenticate a windows user, create their credentials, and then redirect them to a different server while passing the credentials at the...
2
by: Les Peabody | last post by:
Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting the following scenario: I have an index.asp file that has a multi-line text box and a button of type button. When...
3
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a...
3
by: michael | last post by:
let me keep it clean, quick and simple. I am passing a variable into another window and am reassigning the value on the new page - window.document...value = opener.document. ....value and...
5
by: Steve | last post by:
Hi, I currently have a problem passing a variable value from one page to another. Once a form submit button is pressed java pops up a window and displays some information. The problem being is...
2
by: Geoff Cox | last post by:
Hello, The code below is aimed at passing the date in the yyyyMMdd format from the javascript calendar in an html file to the php in a another file which then searches a MySQL database. For...
6
by: vncntj | last post by:
I have this home.js file and I'm trying to collect the values on the other at "emplist.aspx" function poponload() { testwindow= window.open ("emplist.aspx", "mywindow",...
12
meenakshia
by: meenakshia | last post by:
hi forum i have read a lot of articles regarding passing data from popup to parent up but i m looking for the opposite that is from parent to popup window pls help me in this regard i have...
0
by: Adrienne Boswell | last post by:
Gazing into my crystal ball I observed doctor@doctor.nl2k.ab.ca (The Doctor) writing in news:ge58o7$9em$1@gallifrey.nk.ca: <snip> Please understand that 1. For users with javascript...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.