...

View Full Version : check if page is loaded (URL is open)



ajetrumpet
07-21-2009, 10:37 AM
all,

i have a form on an HTML page that i would like to pre-populate based on weather or not other pages in my domain are open in another browser window. i have no idea how to go about doing this.

if someone could help me with this i would greatly appreciate it. ultimately, i am looking to mark certain checkboxes and populate textareas based on if pages are open.

i am also looking to automatically mark the checkboxes, and i know i can use "CHECKED" as part of the INPUT<> tag, but if i understand tags correctly, that would only work on the page load. the marking of the CB's would have to be placed dynamically based on which pages are open. i would appreciate any help on this...thank you.

Philip M
07-21-2009, 11:23 AM
The only way this would be possible would be to set persistent cookies on the "other pages", and check the status of those page.

But remember that Javascript and cookies can be disabled.

What if the 'other pages' are open in another browser window, but minimised?

This does not sound like a very good idea.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

fside
07-21-2009, 01:06 PM
all,

i have a form on an HTML page that i would like to pre-populate based on weather or not other pages in my domain are open in another browser window.


Sounds like a server question. I think you'd want your other pages to actually signal the server on window close that they are being closed. So you'd have to add script to all of them. And if you logged by IP, I suppose you could query your server db on all open pages for that IP. I've never done it, so I'm just suggesting stuff.

But I would think something like that. And I would think it's been done and tested, by someone. Maybe try Google. Or maybe someone has a much better idea.

There's also something new in the latest browsers called - sessionStorage - which takes the idea of persisting data using cookies, and does away with the cookies, making it cleaner. But it would apply to all open windows in the same browser, until I guess all are closed. It's possible if all your pages were set up, that you could go this route. But I haven't yet used this, myself. So I don't know.

ajetrumpet
07-21-2009, 06:03 PM
The only way this would be possible would be to set persistent cookies on the "other pages", and check the status of those page.

But remember that Javascript and cookies can be disabled.

What if the 'other pages' are open in another browser window, but minimised?

This does not sound like a very good idea.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.philip,

i was just spitballing. and yes, you are right...this does NOT sound like a very good idea, but i have to do it somehow. i have also thought of making 4 or 5 different pages, just as clones of the order form template i have on the "checkbox" page. and then, link the appropriate page to the buttons on the other "open" windows. i have diffferent buttons on all the pages that can be opened, so i could link to "different" order pages, based on the button pressed, and simply use the "CHECKED" attribute of the INPUT tag. this does not sound like a good idea either though, but i am simply not experienced with js or HTML. thanks!

fside
07-21-2009, 06:42 PM
philip,

i was just spitballing.


It also sounds like a very different problem. What you SEEM to be describing - without wanting to spill the beans, I guess - what you seem to be describing is a bunch of forms open as either browser tabs or separate browser windows. And you want the forms to communicate just as on a desktop app.

ajetrumpet
07-21-2009, 06:52 PM
fside,

i have a workaround that might work. all i would need is a way to check if a checkbox is disabled or not from a PHP file. do you know of any small js script that i can put in this PHP file to check weather or not my input checkboxes are disabled?

fside
07-22-2009, 05:06 AM
fside,

i have a workaround that might work. all i would need is a way to check if a checkbox is disabled or not from a PHP file. do you know of any small js script that i can put in this PHP file to check weather or not my input checkboxes are disabled?

I'm sure someone here will post that. But is that really the answer when it's not really clear what you're trying to do and so what the problem might be?

Is it like I said in the last message, that you're trying to imitate that way multiple windows might communicate in a desktop app? So you have one form in one box, you fill it in, and it affects the other forms in this case in other window instances of the same browser?

ajetrumpet
07-22-2009, 06:01 AM
I'm sure someone here will post that. But is that really the answer when it's not really clear what you're trying to do and so what the problem might be?

Is it like I said in the last message, that you're trying to imitate that way multiple windows might communicate in a desktop app? So you have one form in one box, you fill it in, and it affects the other forms in this case in other window instances of the same browser?since i don't know js very well, i created 3 different pages and used the CHECKED, and DISABLED attributes of the checkboxes i wanted for those different instances. not the best way to go, but oh well....i'll fix it someday. thanks for your help on this one everyone.../.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum