Small independent window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pat

    #1

    Small independent window

    I want to submit an HTML form and have the reply appear in a small
    window that overlays the form window. After the reply is read, the
    user should be able to delete the small window, and then directly view
    the whole form and resubmit it if desired.

    Stated a different way, I'd like the equivalent of a simple dialog box
    that the CGI can write into.

    So far, about all I've accomplished is to resize the browser window,
    then the user has to use the Back button to return to the form, then
    click the resize button to enlarge the form's window to a useable
    size.

    Help!

    Pat
  • Ivo

    #2
    Re: Small independent window

    "Pat" <pmcclure33@yah oo.com> wrote in message
    news:fdda218c.0 405300954.3b5d4 1a8@posting.goo gle.com...[color=blue]
    > I want to submit an HTML form and have the reply appear in a small
    > window that overlays the form window. After the reply is read, the
    > user should be able to delete the small window, and then directly view
    > the whole form and resubmit it if desired.
    >[/color]

    Look into the target attribute of the form element:
    <form target="_blank" >

    HTH
    Ivo


    Comment

    • Simon Wigzell

      #3
      Re: Small independent window

      Set it up like this:

      <form method="POST" action="results .htm" target="results Window"
      onsubmit="retur n popResults();" name="popResult sForm">
      [Form fields here]
      </form>

      <script>
      function popResults()
      {
      resultsWindow =
      window.open('', 'resultsWindow' ,'toolbar=no,lo cation=no,direc tories=no,statu s
      =no,menubar=no, scrollbars=no,r esizable=no,scr eenX=100,screen Y=100,top=100,l e
      ft=100,width=50 0,height=500');
      }

      This will send your results to a small plain window that will appear in
      front of the main window. results.htm is the file that will appear in the
      popup window, add your form information handling to it. Add a close button
      to the popup window:

      <input type=button value=Close onclick="self.c lose();">

      And you are all set.


      "Ivo" <no@thank.you > wrote in message
      news:40ba3d7b$0 $821$a344fe98@n ews.wanadoo.nl. ..[color=blue]
      > "Pat" <pmcclure33@yah oo.com> wrote in message
      > news:fdda218c.0 405300954.3b5d4 1a8@posting.goo gle.com...[color=green]
      > > I want to submit an HTML form and have the reply appear in a small
      > > window that overlays the form window. After the reply is read, the
      > > user should be able to delete the small window, and then directly view
      > > the whole form and resubmit it if desired.
      > >[/color]
      >
      > Look into the target attribute of the form element:
      > <form target="_blank" >
      >
      > HTH
      > Ivo
      >
      >[/color]


      Comment

      • Pat

        #4
        Re: Small independent window

        "Simon Wigzell" <simonwigzell@s haw.ca> wrote in message news:<dasuc.625 930$oR5.12186@p d7tw3no>...[color=blue]
        > Set it up like this:
        >
        > <form method="POST" action="results .htm" target="results Window"
        > onsubmit="retur n popResults();" name="popResult sForm">
        > [Form fields here]
        > </form>
        >
        > <script>
        > function popResults()
        > {
        > resultsWindow =
        > window.open('', 'resultsWindow' ,'toolbar=no,lo cation=no,direc tories=no,statu s
        > =no,menubar=no, scrollbars=no,r esizable=no,scr eenX=100,screen Y=100,top=100,l e
        > ft=100,width=50 0,height=500');
        > }
        >
        > This will send your results to a small plain window that will appear in
        > front of the main window. results.htm is the file that will appear in the
        > popup window, add your form information handling to it. Add a close button
        > to the popup window:
        >
        > <input type=button value=Close onclick="self.c lose();">
        >
        > And you are all set.
        >
        >
        > "Ivo" <no@thank.you > wrote in message
        > news:40ba3d7b$0 $821$a344fe98@n ews.wanadoo.nl. ..[color=green]
        > > "Pat" <pmcclure33@yah oo.com> wrote in message
        > > news:fdda218c.0 405300954.3b5d4 1a8@posting.goo gle.com...[color=darkred]
        > > > I want to submit an HTML form and have the reply appear in a small
        > > > window that overlays the form window. After the reply is read, the
        > > > user should be able to delete the small window, and then directly view
        > > > the whole form and resubmit it if desired.
        > > >[/color]
        > >
        > > Look into the target attribute of the form element:
        > > <form target="_blank" >
        > >
        > > HTH
        > > Ivo
        > >
        > >Simon & Ivo:[/color][/color]
        Thank you both for your responses. I'm sure your answers will solve
        my problem, and teach me something new, too.

        Thanks again,
        Pat

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Small independent window

          Simon Wigzell wrote:
          [color=blue]
          > Set it up like this:
          >
          > <form method="POST" action="results .htm" target="results Window"
          > onsubmit="retur n popResults();" name="popResult sForm">
          > [Form fields here]
          > </form>
          >
          > <script>[/color]

          The "type" attribute is missing for valid HTML 4.
          [color=blue]
          > function popResults()
          > {
          > resultsWindow =
          > window.open('', 'resultsWindow' ,'toolbar=no,lo cation=no,direc tories=no,statu s
          > =no,menubar=no, scrollbars=no,r esizable=no,scr eenX=100,screen Y=100,top=100,l e
          > ft=100,width=50 0,height=500');
          > }[/color]

          Most of the features you specified with the third argument of window.open()
          are the defaults as of "DOM Level 0". Furthermore, since your assignment
          lacks the `var' keyword, you are creating an global not properly initialized
          and unnecessary here until further notice. Then you hide scrollbars while
          making the popup of fixed size which is clearly a Bad Thing, and return
          *nothing* (i.e. the `undefined' value) from the method but return that
          Nothing to the return value of the called method to the event handler
          instead of returning a boolean value. So after all,

          function popResults()
          {
          window.open(
          '',
          'resultsWindow' ,
          'scrollbars=yes ,resizable=yes, left=100,top=10 0,width=500,hei ght=500'
          );

          return true;
          }

          would be far better than what you wrote.
          [color=blue]
          > This will send your results to a small plain window that will appear in
          > front of the main window. results.htm is the file that will appear in the
          > popup window, add your form information handling to it.[/color]

          No, it won't. What you forgot to take into account is that the popup window
          requires a certain time to get "open", to have memory allocated for its GUI.
          But since Window is a host object, the script engine is not responsible for
          that but the API of the UA is.

          A better, yet untested approach would be to wait until the popup's document
          object is accessible and then return `true' and, in turn, return true to the
          event handler so that the default handler would be used, submitting the form
          data.

          function popResults()
          {
          var w = window.open(
          '',
          'resultsWindow' ,
          'scrollbars=yes ,resizable=yes, left=100,top=10 0,width=500,hei ght=500'
          );

          if (w)
          {
          while (!w.document) ;
          }

          return true;
          }

          Probably the best way is not to use popup "windows" at all for form
          submission. They may be blocked or filtered, and if the user wants
          to review his/her inputs (s)he can use the Back feature (button) of
          his/her UA anyway.
          [color=blue]
          > Add a close button to the popup window:
          >
          > <input type=button value=Close onclick="self.c lose();">
          >
          > And you are all set.[/color]

          No, you are not, on the contrary. IIRC the timing problems that arise
          with such an approach have been discussed several times before here.
          [color=blue]
          > [Top post][/color]

          <http://jibbering.com/faq/#FAQ2_3>


          PointedEars

          Comment

          Working...