Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: how to invoke javascrupt openwindow from html <form>

  1. #1
    Join Date
    Nov 2013

    how to invoke javascrupt openwindow from html <form>

    I want to go to a new window from a form, but I don't see how to position the JS so the parameters are passed.
    This doesn't work:
    <form action=javascriptpWin("http://test.com")>
    <input type=hidden etc.></form>

    How can I pass the <form> parameters?

  2. #2
    Join Date
    Dec 2005

  3. #3
    Join Date
    Nov 2013
    These really don't answer my question. I know how to open a window.
    My questions was how to do it from a <form>. I.e. how to get the <form> parameters properly associated with the open function? Thanks.

  4. #4
    Join Date
    Dec 2005

    You seem to have a way that works
    and another that does not.

    What do you believe would be the advantage to use a <form>?

  5. #5
    Join Date
    Nov 2013
    Why do I want to use <form>? Because what I'm doing requires <form>, requires input data. How else would I do input data without <form>? I can open a new window via <a href> but then I wouldn't have input fields. I do not have a way that works. Is there an answer to my question?

  6. #6
    Join Date
    Dec 2005


    Show some code or provide a live link to your problem.
    Perhaps there is a better way to accomplish your desire.

    You can open an existing site with an included form (with inputs).
    You can create a page with the form and inputs on the fly.
    I don't understand your need to do it via a submit event.

  7. #7
    Join Date
    Nov 2013
    Do you really not understand why anyone would want to go from a <form> directly to a new window?
    It's very simple - the form asks for parameters to be used in generating the new window.
    My specifics don't matter. Just answer the question of how I go from a form to a new window - with parameters from the form. Envision a simple form that gets one input and wants to open the next script in a new window passing the input. That's all I need. If it can't be done, tell me that.

    I should add that I currently do it with an intermediate step - "Continue?" so I can pass parameters with "<a href=javascript:function()>" But the Continue step should not be necessary.
    Last edited by zron; 11-29-2013 at 08:02 PM.

  8. #8
    Join Date
    Nov 2013
    Last edited by zron; 11-29-2013 at 08:03 PM. Reason: delete

  9. #9
    Join Date
    Oct 2013
    I think you need to define what "parameters" you want to pass to the new window/page. URL obviously, but scrollbars? Window size? Menubar? Other? That's going to determine what inputs you need, hidden or not, in your form. It will also determine what needs to be in your JavaScript.

  10. #10
    Join Date
    Nov 2013
    Sorry, thought I was clear. By parameters I mean the input from the form used by the subsequent application. This application is about dog shows - to give you context, lets say a small window asks "what states do you want to see shows from?" and it loads a big window with a list of dog shows in the indicated states. (It's much ore complex than that, but I'm trying to keep the example simple.)

    I don't need help with the JS-level parameters you mention above.

  11. #11
    Join Date
    Oct 2013
    So, to help me wrap my pea-brain around this, and to extend your analogy, let's assume you have a list of all dog show in the USA in 2014. You would like a user to input via your form "I want to see all the dog shows in Idaho in February 2014" (just an example), and have your results window/page open with all those dog shows. Is that a reasonable representation of what you want to happen?

  12. #12
    Join Date
    Nov 2013
    Yes - but the application really isn't the issue. Don't try to suggest different ways to do my application!
    Can't someone just answer the question of how to go from a <form> to a new window with the form parameters (<input>, submit, select, radio, hidden, etc) passed properly? Give me just a simple example with one parameter.

  13. #13
    Join Date
    Oct 2013
    The reason I asked the stupid question is

    1. Yes it's possible to open a window with JavaScript but
    2. JavaScript isn't going to pull your parameters or pass those parameters to a new window without a lot of help

    You basically have a database of dog shows. You will need a server-side solution to display the results of a database query. That involves, probably, MySQL and PHP. Now, JavaScript can open a new window to display the results of that query, but it can't make the query because it's a client-side language. In other words, JS only works on the user's computer, not the server.

  14. #14
    Join Date
    Dec 2005
    Thank you, I have given up trying to communicate with this guy!

  15. #15
    Join Date
    Jan 2014
    This is the mostly used way. As
    <form action="javascript:window.open("www.myonlinemela.blogspot.com")>

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.12906 seconds
  • Memory Usage 3,006KB
  • Queries Executed 15 (?)
More Information
Template Usage (35):
  • (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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)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 (74):
  • 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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • 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