Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts

    check if page is loaded (URL is open)

    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.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    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.
    Last edited by Philip M; 07-21-2009 at 12:41 PM.

  • #3
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Quote Originally Posted by ajetrumpet View Post
    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.
    Last edited by fside; 07-21-2009 at 02:32 PM.

  • #4
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Philip M View Post
    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!

  • #5
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Quote Originally Posted by ajetrumpet View Post
    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.

  • #6
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    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?

  • #7
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Quote Originally Posted by ajetrumpet View Post
    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?

  • #8
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by fside View Post
    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.../.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •