473,545 Members | 937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing values fields between pages

I have two pages
one.html
two.html

page one.html
have a form named form1 and a textarea named text1
man one write in the textarea text 1

page two.html
have a form named form2 and a textarea named text2
man two read in the textarea text 2

The pages aren't in the same domain.
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
Is like a chat but not a chat. The man one not have to submit the
form.
Thanks
Regards

Sep 28 '07 #1
8 1892
pt36 wrote:
I have two pages
one.html
two.html

page one.html
have a form named form1 and a textarea named text1
man one write in the textarea text 1

page two.html
have a form named form2 and a textarea named text2
man two read in the textarea text 2

The pages aren't in the same domain.
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
Is like a chat but not a chat. The man one not have to submit the
form.
Thanks
Regards
Hi,

I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
If the domains are on the same physical server, you'll only need 1 of
course. ;-)

So some serverside coding is needed, eg in PHP or Perl.

It is easy to send the data typed in text1 to a server, server1, (with
keyup-event) via some AJAXOID solution.

It will be harder to keep form2 up to date, because it has to pull the
new data from server1, via server2.

Server2 talks with server1 to get the data in.

Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.

Personally I think this is quite a horrible solution, since you create a
lot of serverload on both the servers.
Server1 gets a lot of AJAX requests in to update each letter that is
typed (keyup event).
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.

You might consider a different technology, Java eg.

Regards,
Erwin Moller
Sep 28 '07 #2
On Fri, 28 Sep 2007 11:06:16 +0200, Erwin Moller wrote:
pt36 wrote:
>[...]
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
[...]

I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
[...]
Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.
[...]
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.

It might be more efficient for Server2 to delay responding until there is
data to send to form2, subject to some maximum delay to avoid timeout. If
there is no new data most of the time (that is, the user of form1 isn't
typing most of them time), this will dramatically reduce the number of
server requests made. This will of course require careful implementation of
the server-side code to avoid it locking up the server.
--
Safalra (Stephen Morley)

Sortable Tables In javascript:
http://www.safalra.com/programming/j...rtable-tables/
Sep 28 '07 #3
Safalra wrote:
On Fri, 28 Sep 2007 11:06:16 +0200, Erwin Moller wrote:
>pt36 wrote:
>>[...]
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
[...]
I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
[...]
Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.
[...]
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.


It might be more efficient for Server2 to delay responding until there is
data to send to form2, subject to some maximum delay to avoid timeout. If
there is no new data most of the time (that is, the user of form1 isn't
typing most of them time), this will dramatically reduce the number of
server requests made. This will of course require careful implementation of
the server-side code to avoid it locking up the server.
Absolutely true.
Good improvement.

Regards,
Erwin Moller
Sep 28 '07 #4
Safalra wrote:
On Fri, 28 Sep 2007 11:06:16 +0200, Erwin Moller wrote:
pt36 wrote:
[...]
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
[...]
I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
[...]
Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.
[...]
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.

It might be more efficient for Server2 to delay responding until there is
data to send to form2, subject to some maximum delay to avoid timeout. If
there is no new data most of the time (that is, the user of form1 isn't
typing most of them time), this will dramatically reduce the number of
server requests made.
I don't think this would be a wise strategy, because Form2 cannot know
when Man1 types. Form2 needs to go to server anyway to check whether
the data has updated (that is, Man2 needs to initiate every request).

If Man2 fires this request and no data has updated, then you could
indeed delay the response for e.g. 20 seconds; but Man1 can type
something new during those 20 seconds, which can then only be shown to
Man2 after 20 seconds (at the following request that Man2 fires).

A one-second delay of Man2 would seem reasonable to me.
This will of course require careful implementation of
the server-side code to avoid it locking up the server.
The load on server is indeed very high in such scenarios; I think it's
better to use Java like Erwin suggested. Or Flash.

--
Bart

Sep 28 '07 #5
On 28 Sep, 10:06, Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
pt36 wrote:
I have two pages
one.html
two.html
page one.html
have a form named form1 and a textarea named text1
man one write in the textarea text 1
page two.html
have a form named form2 and a textarea named text2
man two read in the textarea text 2
The pages aren't in the same domain.
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
Is like a chat but not a chat. The man one not have to submit the
form.
Thanks
Regards

Hi,

I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
If the domains are on the same physical server, you'll only need 1 of
course. ;-)

So some serverside coding is needed, eg in PHP or Perl.

It is easy to send the data typed in text1 to a server, server1, (with
keyup-event) via some AJAXOID solution.

It will be harder to keep form2 up to date, because it has to pull the
new data from server1, via server2.

Server2 talks with server1 to get the data in.

Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.

Personally I think this is quite a horrible solution, since you create a
lot of serverload on both the servers.
Server1 gets a lot of AJAX requests in to update each letter that is
typed (keyup event).
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.

You might consider a different technology, Java eg.

Regards,
Erwin Moller- Hide quoted text -

- Show quoted text -
As a matter of interest, how does Google Talk in the GoogleMail
browser window handle this? It give indication that the otehr party is
typing a message and then delivers it when it is complete?

Sep 28 '07 #6
On Fri, 28 Sep 2007 06:11:46 -0700, Bart Van der Donck wrote:
Safalra wrote:
>On Fri, 28 Sep 2007 11:06:16 +0200, Erwin Moller wrote:
>>pt36 wrote:
[...]
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
[...]
>>I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
[...]
Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.
[...]
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.

It might be more efficient for Server2 to delay responding until there is
data to send to form2, subject to some maximum delay to avoid timeout. If
there is no new data most of the time (that is, the user of form1 isn't
typing most of them time), this will dramatically reduce the number of
server requests made.

I don't think this would be a wise strategy, because Form2 cannot know
when Man1 types. Form2 needs to go to server anyway to check whether
the data has updated (that is, Man2 needs to initiate every request).

If Man2 fires this request and no data has updated, then you could
indeed delay the response for e.g. 20 seconds; but Man1 can type
something new during those 20 seconds, which can then only be shown to
Man2 after 20 seconds (at the following request that Man2 fires).

You've misundertood what I mean. Form2 will know when Man1 types, because
as soon as Man1 types the server is informed and then responds to Form2.
Permit me to explain with two examples:

If Man1 isn't typing:

- Form2 makes a server request
- Nothing happens for 20 seconds
- The server responds to Form2, saying nothing has happened
- Form2 makes another server request
- ...and so on

If Man1 is typing:

- Form2 makes a server request
- Nothing happens for a bit
- Form1 makes a server request sending new data
- The server responds to Form2, with the new data
- Form2 makes another server request
- ...and so on

Form2 is constanly in communication with the server, but if Man1 isn't
typing then the server only responds every 20 seconds, saying that nothing
has happened. If Man1 is typing, the server responds as soon as it receives
input (although to avoid heavy server load when Man1 is typing it shouldn't
respond to Form2 until some amount of time after the request was made - one
second, for example). The only tricky part is writing server-side code that
doesn't lock up the server while waiting to see if new data arrives from
Form1
--
Safalra (Stephen Morley)

Sortable Tables In javascript:
http://www.safalra.com/programming/j...rtable-tables/
Sep 28 '07 #7
Safalra wrote:
On Fri, 28 Sep 2007 06:11:46 -0700, Bart Van der Donck wrote:
Safalra wrote:
On Fri, 28 Sep 2007 11:06:16 +0200, Erwin Moller wrote:
pt36 wrote:
[...]
I want, if is possible, that the page two.html show in the textarea
text 2 that a man one write in the textarea text 1 in realtime (like
onkeyup)
[...]
>I think you'll have to make a trip via a server.
Two servers actually if they are in different domains.
[...]
Can be done, but you'll have to poll server2 a lot to get a fast
response in text2.
[...]
Server2 will be busy because the javascript in the page with form2 is
polling the server every second or so.
It might be more efficient for Server2 to delay responding until there is
data to send to form2, subject to some maximum delay to avoid timeout. If
there is no new data most of the time (that is, the user of form1 isn't
typing most of them time), this will dramatically reduce the number of
server requests made.
I don't think this would be a wise strategy, because Form2 cannot know
when Man1 types. Form2 needs to go to server anyway to check whether
the data has updated (that is, Man2 needs to initiate every request).
If Man2 fires this request and no data has updated, then you could
indeed delay the response for e.g. 20 seconds; but Man1 can type
something new during those 20 seconds, which can then only be shown to
Man2 after 20 seconds (at the following request that Man2 fires).

You've misundertood what I mean. Form2 will know when Man1 types, because
as soon as Man1 types the server is informed and then responds to Form2.
Permit me to explain with two examples:

If Man1 isn't typing:

- Form2 makes a server request
- Nothing happens for 20 seconds
- The server responds to Form2, saying nothing has happened
- Form2 makes another server request
- ...and so on

If Man1 is typing:

- Form2 makes a server request
- Nothing happens for a bit
- Form1 makes a server request sending new data
- The server responds to Form2, with the new data
- Form2 makes another server request
- ...and so on
Ah, now I see it better. Yes I believe this would be a good plan, by
disabling the output buffer of the server script and let it run for 20
seconds (having its own sub-interval of 1 second or so).
Form2 is constanly in communication with the server, but if Man1 isn't
typing then the server only responds every 20 seconds, saying that nothing
has happened. If Man1 is typing, the server responds as soon as it receives
input (although to avoid heavy server load when Man1 is typing it shouldn't
respond to Form2 until some amount of time after the request was made - one
second, for example). The only tricky part is writing server-side code that
doesn't lock up the server while waiting to see if new data arrives from
Form1
I don't think this should be tricky - I'm quite familiar with these
kinds of constructions:

Preparation: investigate how much time-out is allowed for the CGI

Script actions:
(1) disable output buffer of script
(2) check if writable file has been updated by Man1
- if yes, respond with new content to Man2
- if no, send negative flag to Man2, sleep 1 second and
perform (2) twenty times in total
(3) new request from Man2: back to (1)

Man1 should then update the content with an onKeyUp event. I think
there should also be a limit on the (allowed number of) characters in
Man1's textarea, and always check for nicely terminated requests/
responses.

I remember using Netscape's Server Push about 10-15 years ago for this
kind of applications. It would be ideal here, but it's not supported
anymore. Anyway, Java still better :-)

--
Bart

Sep 28 '07 #8
Bart Van der Donck wrote:
Script actions:
(1) disable output buffer of script
(2) check if writable file has been updated by Man1
- if yes, respond with new content to Man2
- if no, send negative flag to Man2, sleep 1 second and
perform (2) twenty times in total
Even better (and now I fully see your plan, I think):

- if no, send nothing to Man2, sleep 1 second internally
and keep checking when the contents of writable file has
changed, then only output to Man2 when it has actually
changed and close connection afterwards

--
Bart

Sep 28 '07 #9

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

Similar topics

4
7163
by: Ryann | last post by:
Hello. I am creating a form that has 5 steps/pages. Each page contains about 20 fields. But I don't want to write them until they submit on the last page. I figured out that I can use hidden fields to carry the data from the previous forms forward. If should bascially work like this: Page 1 Page 2 Page 3 Page 4 Page 5 ...
10
2809
by: Joseph S. | last post by:
Hi, How do I pass a string from one call to a php block to another call in the same page but from another form? Here's my full php code: I'm using two forms in the same page. A hidden field 'f' with values '1' and '2' are used to distinguish calls from one form from those from the
1
3026
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht ml/cpconPassingServerControlValuesBetweenPages.asp) So, I have two pages, one that has some public properties and fires a Server.Transfer("receivepage.aspx"); The...
0
1078
by: Rico Singleton | last post by:
I currently have an asp page that contains a simple form and a few hidden fields. One of those hidden fields retrieves a value passed in when a link is clicked that passes a value (i.e http://www.somewhere.com/contact.asp?52 ) The code works fine on as an asp page on IIS 5.5 however, in trying to migrate the pages on to IIS 6.0 with .NET...
1
2693
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store state data. The only ASP.NET options left is to use the Server.Transfer to transfer to page 2 from page 1, and then use the context to get whatever...
1
2264
by: williamroy | last post by:
Hello, I've got a form that runs over 5 pages. I need the last page submit button to post all of the answers at one time from the previous 5 pages (to another server). I'd like to see the last page of the form post all answers in clean ?= format as though all form elements were from one page. I use GET to pass name/value pairs from the...
3
2088
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening when I pass a class as a parameter to a Windows Form. Basically, I have a class that has several fields, two of these fields are an instance of an...
28
3103
by: Skeets | last post by:
i'm passing session and hidden variables between pages. not to mention post values. i'm a little concerned that someone with sufficient knowledge could spoof these vlaues and manipulate the program. is this a valid concern? i'm thinking i can check the submitting page setting up something around the following the following code... ...
1
2330
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values from one to the other. 1. The postbackurl method doesn't seem to work with master pages. If I take away the master pages it works. 2. The...
3
2276
by: dbuchanan | last post by:
newbie question What are the various ways that data can be passed between pages. For example; How is data about the logged in user passed to subsequent pages Thank you, Doug
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1879
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.