Results 1 to 6 of 6

Thread: Set different parent window

  1. #1
    Join Date
    Aug 2009

    Set different parent window


    I am trying to update a parent window with data from a child window.

    Now that doesn't sound so difficult, except for the fact that I am letting the visitor of my website choose from a selection list on the child page. Once the selection has been made, the child page automatically gets refreshed (also with javascript) so a subselection gets available.

    Now when my page gets refreshed I loose the reference of the parent page.

    Is it possible to retain this value somehow or te set is again somehow with data I have posted?

    Many thanks,


  2. #2
    Join Date
    Mar 2010
    Quote Originally Posted by funzoh View Post

    Is it possible to retain this value somehow or te set is again somehow with data I have posted?
    I am assuming that some form information from the child window is being sent to a server side script, some number crunching then happens and you then want to display the results back in the parent window.

    If that is so, another and imo easier approach would be to display the child window in the parent window (I'm not sure why you need 2 windows in the first place) and when the server side script has completed its number crunching it can then redirect back to the url of whatever was in the parent window originally and the latest information from the database should then be displayed.

  3. #3
    Join Date
    Aug 2009
    Hi Tirna,

    Thanks for your reply.

    I am creating a lookup button on which my visitors need to click to lookup some value from a database. The visitor needs to make a category selection which narrows down the list to a subselection from which they can choose. E.g. If you make a database with postal codes. They first need to select the state. The child window sends the data to the server and receives all zip codes in that state from which the visitor can select (also within the child window). When the visitor selects a zip-code, it returns its value to the parent window.

    To be able to do so, I need to post the selected (first) in the child window, which refreshes the child window and which causes the parent setting to be reset.

    I would like to accomplish this because else I would be forced to refill a lot of form data in the parent window which the user has entered earlier (like eg name, street, phone, and lots more). It also gets more complicated because I would have to lookup data from 2 different databases which require seperate database connections at one time. By splitting this functionality to a parent-child setup, it eases up the work a lot and it would make my site much easier to maintain.

    Greetings, Funzoh.

  4. #4
    Join Date
    Mar 2010
    Ok I think what you want is becoming clearer but if I understand you correctly in your example you would have a select list of states with a select list of zip codes with initially no options for zip codes until the user selects a state in the first select list.

    If that is so, you can have both select lists on the one page with the states select list populated with the states and the zip codes select list initially empty.

    When the user selects a state, the select lists onChange event handler can send an ajax request to the server to get the zip codes for that state and send them back to the client browser to populate the zip codes select list.

    Then the selected state, zip code and other form data can be sent to a server side script for processing when submit is clicked.

    This way you only need one window.

    Am I still misunderstanding what you want?

  5. #5
    Join Date
    Aug 2009
    Whow, that even sounds better than what I was hoping to do with that second window!
    I think you have just helped me on the right tracks again. I will try this out today.

    Many Thanks!

  6. #6
    Join Date
    Aug 2009


    Yep, that really did the trick for me. I have to say I am a bit new in Javascript and Ajax as you can see, but I am always keen to learning new stuff and I must say this opens up a new world for me.

    Many thanks Tirna!



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.18227 seconds
  • Memory Usage 2,890KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates