Loading ...
Sorry, an error occurred while loading the content.

Cannot define Dialog div inside a tag

Expand Messages
  • Scott Rankin
    Hello, I m trying to make part of my HTML form a dialog that pops up instead of a series of textboxes on a page. However, when I load the page with the
    Message 1 of 11 , Oct 6, 2006
    • 0 Attachment
      Hello,

      I'm trying to make part of my HTML form a dialog that pops up instead
      of a series of textboxes on a page. However, when I load the page
      with the dialog's DIV declared inside the <form> tag, I get an error
      saying "form has no properties" on container.js line 3234 (this is
      0.11.4). If I move the dialog's DIV outside, it works, but then my
      inputs that are on the dialog no longer get submitted when my main
      page is submitted.

      This is easily reproducible with the dialog.html example page shipped
      with yui.zip - just simply add a <form> element right inside the
      <body> tag and reload the page - you'll get a JavaScript error.

      Is this misuing the library? It seems that it would be quite powerful
      to be able to expose parts of your form in a dialog rather than inline
      on the page, but still have only one main page form submit to worry
      about...

      Thanks,

      Scott
    • Michael Newton
      Perhaps you could provide some sample code. Doing as you suggest below would result in a form within a form, which is another problem altogether.
      Message 2 of 11 , Oct 6, 2006
      • 0 Attachment
        Perhaps you could provide some sample code. Doing as you suggest
        below would result in a form within a form, which is another problem
        altogether.

        --- In ydn-javascript@yahoogroups.com, "Scott Rankin"
        <scott.rankin@...> wrote:
        > This is easily reproducible with the dialog.html example page shipped
        > with yui.zip - just simply add a <form> element right inside the
        > <body> tag and reload the page - you'll get a JavaScript error.
        >
      • Brian Moeskau
        The dialog looks inside it s container tag for an existing form, and if it doesn t find one, creates a dynamic one on the fly to wrap its contents. This is
        Message 3 of 11 , Oct 7, 2006
        • 0 Attachment
          The dialog looks inside it's container tag for an existing form, and
          if it doesn't find one, creates a dynamic one on the fly to wrap its
          contents. This is definitely a problem when you have to use a
          higher-level containing form (a la ASP.NET) since a form cannot
          legally contain another form. Ideally, YUI would look at the entire
          DOM contents for a form, but at present it does not.

          This thread may help as a workaround (I have not yet tried the advice
          given myself):

          http://tech.groups.yahoo.com/group/ydn-javascript/message/4902

          Let us know if you try it or find a different workaround.

          Brian

          --- In ydn-javascript@yahoogroups.com, "Scott Rankin"
          <scott.rankin@...> wrote:
          >
          > Hello,
          >
          > I'm trying to make part of my HTML form a dialog that pops up instead
          > of a series of textboxes on a page. However, when I load the page
          > with the dialog's DIV declared inside the <form> tag, I get an error
          > saying "form has no properties" on container.js line 3234 (this is
          > 0.11.4). If I move the dialog's DIV outside, it works, but then my
          > inputs that are on the dialog no longer get submitted when my main
          > page is submitted.
          >
          > This is easily reproducible with the dialog.html example page shipped
          > with yui.zip - just simply add a <form> element right inside the
          > <body> tag and reload the page - you'll get a JavaScript error.
          >
          > Is this misuing the library? It seems that it would be quite powerful
          > to be able to expose parts of your form in a dialog rather than inline
          > on the page, but still have only one main page form submit to worry
          > about...
          >
          > Thanks,
          >
          > Scott
          >
        • Scott Rankin
          Brian, Thanks for the link to that workaround - I will certainly give it a try. I agree that the Dialog should have the ability to participate in an existing
          Message 4 of 11 , Oct 7, 2006
          • 0 Attachment
            Brian,

            Thanks for the link to that workaround - I will certainly give it a
            try. I agree that the Dialog should have the ability to participate
            in an existing form, and maybe the Yahoo folks will listen and include
            it in an upcoming version.

            Regards,

            Scott

            --- In ydn-javascript@yahoogroups.com, "Brian Moeskau" <brian@...> wrote:
            >
            > The dialog looks inside it's container tag for an existing form, and
            > if it doesn't find one, creates a dynamic one on the fly to wrap its
            > contents. This is definitely a problem when you have to use a
            > higher-level containing form (a la ASP.NET) since a form cannot
            > legally contain another form. Ideally, YUI would look at the entire
            > DOM contents for a form, but at present it does not.
            >
            > This thread may help as a workaround (I have not yet tried the advice
            > given myself):
            >
            > http://tech.groups.yahoo.com/group/ydn-javascript/message/4902
            >
            > Let us know if you try it or find a different workaround.
            >
            > Brian
            >
            > --- In ydn-javascript@yahoogroups.com, "Scott Rankin"
            > <scott.rankin@> wrote:
            > >
            > > Hello,
            > >
            > > I'm trying to make part of my HTML form a dialog that pops up instead
            > > of a series of textboxes on a page. However, when I load the page
            > > with the dialog's DIV declared inside the <form> tag, I get an error
            > > saying "form has no properties" on container.js line 3234 (this is
            > > 0.11.4). If I move the dialog's DIV outside, it works, but then my
            > > inputs that are on the dialog no longer get submitted when my main
            > > page is submitted.
            > >
            > > This is easily reproducible with the dialog.html example page shipped
            > > with yui.zip - just simply add a <form> element right inside the
            > > <body> tag and reload the page - you'll get a JavaScript error.
            > >
            > > Is this misuing the library? It seems that it would be quite powerful
            > > to be able to expose parts of your form in a dialog rather than inline
            > > on the page, but still have only one main page form submit to worry
            > > about...
            > >
            > > Thanks,
            > >
            > > Scott
            > >
            >
          • Steven Peterson
            Scott, You can define your Dialog anywhere that you would like to. The key is where you decide to render it. Your best bet is to call
            Message 5 of 11 , Oct 9, 2006
            • 0 Attachment

              Scott,

               

              You can define your Dialog anywhere that you would like to. The key is where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It’s generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.

               

              Thanks!

              Steven Peterson

              Web Developer, Platform Engineering

              Yahoo!

               

               

               

              From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
              Sent: Friday, October 06, 2006 2:29 PM
              To: ydn-javascript@yahoogroups.com
              Subject: [ydn-javascript] Cannot define Dialog div inside a <form> tag

               

              Hello,

              I'm trying to make part of my HTML form a dialog that pops up instead
              of a series of textboxes on a page. However, when I load the page
              with the dialog's DIV declared inside the <form> tag, I get an error
              saying "form has no properties" on container.js line 3234 (this is
              0.11.4). If I move the dialog's DIV outside, it works, but then my
              inputs that are on the dialog no longer get submitted when my main
              page is submitted.

              This is easily reproducible with the dialog.html example page shipped
              with yui.zip - just simply add a <form> element right inside the
              <body> tag and reload the page - you'll get a JavaScript error.

              Is this misuing the library? It seems that it would be quite powerful
              to be able to expose parts of your form in a dialog rather than inline
              on the page, but still have only one main page form submit to worry
              about...

              Thanks,

              Scott

            • Alessandro Vernet
              Steven, I have the same problem as Scott: I need the dialog to be inside an existing form in the page, and I don t need the library to create its own form. So
              Message 6 of 11 , Oct 13, 2006
              • 0 Attachment
                Steven,

                I have the same problem as Scott: I need the dialog to be inside an
                existing form in the page, and I don't need the library to create its
                own form. So for now I just added a "return;" at the beginning of
                registerForm(), but it would be useful to be able to disable this
                feature, if it is not needed.

                Alex

                On 10/9/06, Steven Peterson <peterson@...> wrote:
                >
                >
                >
                >
                > Scott,
                >
                >
                >
                > You can define your Dialog anywhere that you would like to. The key is where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It's generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.
                >
                >
                >
                > Thanks!
                >
                > Steven Peterson
                >
                > Web Developer, Platform Engineering
                >
                > Yahoo!
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
                > Sent: Friday, October 06, 2006 2:29 PM
                > To: ydn-javascript@yahoogroups.com
                > Subject: [ydn-javascript] Cannot define Dialog div inside a <form> tag
                >
                >
                >
                >
                >
                >
                > Hello,
                >
                > I'm trying to make part of my HTML form a dialog that pops up instead
                > of a series of textboxes on a page. However, when I load the page
                > with the dialog's DIV declared inside the <form> tag, I get an error
                > saying "form has no properties" on container.js line 3234 (this is
                > 0.11.4). If I move the dialog's DIV outside, it works, but then my
                > inputs that are on the dialog no longer get submitted when my main
                > page is submitted.
                >
                > This is easily reproducible with the dialog.html example page shipped
                > with yui.zip - just simply add a <form> element right inside the
                > <body> tag and reload the page - you'll get a JavaScript error.
                >
                > Is this misuing the library? It seems that it would be quite powerful
                > to be able to expose parts of your form in a dialog rather than inline
                > on the page, but still have only one main page form submit to worry
                > about...
                >
                > Thanks,
                >
                > Scott
                >
                >



                --
                Blog (XML, Web apps, Open Source):
                http://www.orbeon.com/blog/
              • Steven Peterson
                Alex, Like I suggested to Scott, Dialog generally should not be rendered nested in another element if at all possible. You can achieve this by calling render
                Message 7 of 11 , Oct 13, 2006
                • 0 Attachment

                  Alex,

                   

                  Like I suggested to Scott, Dialog generally should not be rendered nested in another element if at all possible. You can achieve this by calling render with document.body as an argument. In that case, the Dialog will be rendered outside of the default ASP.NET form, so you shouldn’t encounter this issue. The initial placement of the markup is not important, but the final place where the Dialog ends up is significant.  The form currently cannot be disabled because it is relied upon by the Dialog as a container for the form elements that will ultimately be submitted to the server. However, if the markup is placed correctly, the coexistence of two forms on your page should not be a problem.  It would be great if you could let me know if the render argument solves your issue, so that I’ll be able to recommend it to people in the future if they encounter this issue in the future.

                   

                  Thanks!

                  Steven Peterson

                  Web Developer, Platform Engineering

                  Yahoo!

                   

                   

                  From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
                  Sent: Friday, October 13, 2006 6:11 PM
                  To: ydn-javascript@yahoogroups.com
                  Subject: Re: [ydn-javascript] Cannot define Dialog div inside a <form> tag

                   

                  Steven,

                  I have the same problem as Scott: I need the dialog to be inside an
                  existing form in the page, and I don't need the library to create its
                  own form. So for now I just added a "return;" at the beginning of
                  registerForm(), but it would be useful to be able to disable this
                  feature, if it is not needed.

                  Alex

                  On 10/9/06, Steven Peterson <peterson@...> wrote:

                  >
                  >
                  >
                  >
                  > Scott,
                  >
                  >
                  >
                  > You can define your Dialog anywhere that you would like to. The key is
                  where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It's generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.
                  >
                  >
                  >
                  > Thanks!
                  >
                  > Steven Peterson
                  >
                  > Web Developer, Platform Engineering
                  >
                  > Yahoo!
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > From: ydn-javascript@yahoogroups.com
                  [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
                  > Sent: Friday, October 06, 2006 2:29 PM
                  > To: ydn-javascript@yahoogroups.com
                  > Subject: [ydn-javascript] Cannot define Dialog div inside a <form>
                  tag
                  >
                  >
                  >
                  >
                  >
                  >
                  > Hello,
                  >
                  > I'm trying to make part of my HTML form a dialog that pops up instead
                  > of a series of textboxes on a page. However, when I load the page
                  > with the dialog's DIV declared inside the <form> tag, I get an error
                  > saying "form has no properties" on container.js line 3234 (this
                  is
                  > 0.11.4). If I move the dialog's DIV outside, it works, but then my
                  > inputs that are on the dialog no longer get submitted when my main
                  > page is submitted.
                  >
                  > This is easily reproducible with the dialog.html example page shipped
                  > with yui.zip - just simply add a <form> element right inside the
                  > <body> tag and reload the page - you'll get a JavaScript error.
                  >
                  > Is this misuing the library? It seems that it would be quite powerful
                  > to be able to expose parts of your form in a dialog rather than inline
                  > on the page, but still have only one main page form submit to worry
                  > about...
                  >
                  > Thanks,
                  >
                  > Scott
                  >
                  >

                  --
                  Blog (XML, Web apps, Open Source):
                  http://www.orbeon.com/blog/

                • Bart King
                  Hi there, Just a thought on this - in the context of ASP.NET, if you define a outside the main , when the form used in a YUI Dialog is submitted,
                  Message 8 of 11 , Oct 15, 2006
                  • 0 Attachment
                    Hi there,

                    Just a thought on this - in the context of ASP.NET, if you define a
                    <form> outside the main <form>, when the form used in a YUI Dialog is
                    submitted, this form will be missing the viewstate, which may cause
                    additional headaches on the ASP.NET postback mechanism (unless the form
                    is submitted using GET, but, ugh..).

                    I think using a standard modal Panel instead of a Dialog fits the
                    ASP.NET model more effectively (since you can just assign a standard
                    <asp:Panel visible="false"> for the YUI Panel, or of course, use
                    stylesheets).

                    I'm due to tackle this very issue this afternoon :)

                    Cheers,
                    --
                    Bart King
                    http://www.bart666.com -- +44 781 219 5654


                    -----Original Message-----
                    From: ydn-javascript@yahoogroups.com
                    [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Steven Peterson
                    Sent: 14 October 2006 02:26
                    To: ydn-javascript@yahoogroups.com
                    Subject: RE: [ydn-javascript] Cannot define Dialog div inside a <form>
                    tag

                    Alex,



                    Like I suggested to Scott, Dialog generally should not be rendered
                    nested in another element if at all possible. You can achieve this by
                    calling render with document.body as an argument. In that case, the
                    Dialog will be rendered outside of the default ASP.NET form, so you
                    shouldn't encounter this issue. The initial placement of the markup is
                    not important, but the final place where the Dialog ends up is
                    significant. The form currently cannot be disabled because it is relied
                    upon by the Dialog as a container for the form elements that will
                    ultimately be submitted to the server. However, if the markup is placed
                    correctly, the coexistence of two forms on your page should not be a
                    problem. It would be great if you could let me know if the render
                    argument solves your issue, so that I'll be able to recommend it to
                    people in the future if they encounter this issue in the future.



                    Thanks!

                    Steven Peterson

                    Web Developer, Platform Engineering

                    Yahoo!





                    From: ydn-javascript@yahoogroups.com
                    [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
                    Sent: Friday, October 13, 2006 6:11 PM
                    To: ydn-javascript@yahoogroups.com
                    Subject: Re: [ydn-javascript] Cannot define Dialog div inside a <form>
                    tag



                    Steven,

                    I have the same problem as Scott: I need the dialog to be inside an
                    existing form in the page, and I don't need the library to create its
                    own form. So for now I just added a "return;" at the beginning of
                    registerForm(), but it would be useful to be able to disable this
                    feature, if it is not needed.

                    Alex

                    On 10/9/06, Steven Peterson <peterson@...
                    <mailto:peterson%40yahoo-inc.com> > wrote:
                    >
                    >
                    >
                    >
                    > Scott,
                    >
                    >
                    >
                    > You can define your Dialog anywhere that you would like to. The key is
                    where you decide to render it. Your best bet is to call
                    myDialog.render(document.body) so that the markup is initially rendered
                    within your form, but is allowed to escape the form when the render
                    method is called. It's generally best to render your Dialogs to the body
                    anyway, because then you are guaranteed that your z-index will always
                    supercede any other absolutely or relatively positioned elements in the
                    page. Try that one-line fix and let me know how it works for you.
                    >
                    >
                    >
                    > Thanks!
                    >
                    > Steven Peterson
                    >
                    > Web Developer, Platform Engineering
                    >
                    > Yahoo!
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    > From: ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    > [mailto:ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com> ] On Behalf Of Scott Rankin
                    > Sent: Friday, October 06, 2006 2:29 PM
                    > To: ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    > Subject: [ydn-javascript] Cannot define Dialog div inside a <form> tag
                    >
                    >
                    >
                    >
                    >
                    >
                    > Hello,
                    >
                    > I'm trying to make part of my HTML form a dialog that pops up instead
                    > of a series of textboxes on a page. However, when I load the page with

                    > the dialog's DIV declared inside the <form> tag, I get an error saying

                    > "form has no properties" on container.js line 3234 (this is 0.11.4).
                    > If I move the dialog's DIV outside, it works, but then my inputs that
                    > are on the dialog no longer get submitted when my main page is
                    > submitted.
                    >
                    > This is easily reproducible with the dialog.html example page shipped
                    > with yui.zip - just simply add a <form> element right inside the
                    > <body> tag and reload the page - you'll get a JavaScript error.
                    >
                    > Is this misuing the library? It seems that it would be quite powerful
                    > to be able to expose parts of your form in a dialog rather than inline

                    > on the page, but still have only one main page form submit to worry
                    > about...
                    >
                    > Thanks,
                    >
                    > Scott
                    >
                    >

                    --
                    Blog (XML, Web apps, Open Source):
                    http://www.orbeon.com/blog/
                  • Alessandro Vernet
                    Hi Steven, Just like Bart mentioned, placing the dialog in a div at the document.body level does not work in this case. I would like the dialog markup to stay
                    Message 9 of 11 , Nov 1, 2006
                    • 0 Attachment
                      Hi Steven,

                      Just like Bart mentioned, placing the dialog in a div at the
                      document.body level does not work in this case. I would like the
                      dialog markup to stay inside my form, because the dialog has form
                      controls, which need to be inside my form.

                      I am well aware that this interferes with the ability of the dialog to
                      submit data to the server on its own, but for the use case I have
                      here, this is an ability that I don't need. I just want a great dialog
                      :). So in the meantime, I will keep the "return;" inserted as the
                      first statement of registerForm().

                      Alex

                      On 10/13/06, Steven Peterson <peterson@...> wrote:
                      >
                      >
                      >
                      >
                      > Alex,
                      >
                      >
                      >
                      > Like I suggested to Scott, Dialog generally should not be rendered nested in another element if at all possible. You can achieve this by calling render with document.body as an argument. In that case, the Dialog will be rendered outside of the default ASP.NET form, so you shouldn't encounter this issue. The initial placement of the markup is not important, but the final place where the Dialog ends up is significant. The form currently cannot be disabled because it is relied upon by the Dialog as a container for the form elements that will ultimately be submitted to the server. However, if the markup is placed correctly, the coexistence of two forms on your page should not be a problem. It would be great if you could let me know if the render argument solves your issue, so that I'll be able to recommend it to people in the future if they encounter this issue in the future.
                      >
                      >
                      >
                      > Thanks!
                      >
                      > Steven Peterson
                      >
                      > Web Developer, Platform Engineering
                      >
                      > Yahoo!
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      > From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
                      > Sent: Friday, October 13, 2006 6:11 PM
                      > To: ydn-javascript@yahoogroups.com
                      > Subject: Re: [ydn-javascript] Cannot define Dialog div inside a <form> tag
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      > Steven,
                      >
                      > I have the same problem as Scott: I need the dialog to be inside an
                      > existing form in the page, and I don't need the library to create its
                      > own form. So for now I just added a "return;" at the beginning of
                      > registerForm(), but it would be useful to be able to disable this
                      > feature, if it is not needed.
                      >
                      > Alex
                      >
                      > On 10/9/06, Steven Peterson <peterson@...> wrote:
                      > >
                      > >
                      > >
                      > >
                      > > Scott,
                      > >
                      > >
                      > >
                      > > You can define your Dialog anywhere that you would like to. The key is where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It's generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.
                      > >
                      > >
                      > >
                      > > Thanks!
                      > >
                      > > Steven Peterson
                      > >
                      > > Web Developer, Platform Engineering
                      > >
                      > > Yahoo!
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
                      > > Sent: Friday, October 06, 2006 2:29 PM
                      > > To: ydn-javascript@yahoogroups.com
                      > > Subject: [ydn-javascript] Cannot define Dialog div inside a <form> tag
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > Hello,
                      > >
                      > > I'm trying to make part of my HTML form a dialog that pops up instead
                      > > of a series of textboxes on a page. However, when I load the page
                      > > with the dialog's DIV declared inside the <form> tag, I get an error
                      > > saying "form has no properties" on container.js line 3234 (this is
                      > > 0.11.4). If I move the dialog's DIV outside, it works, but then my
                      > > inputs that are on the dialog no longer get submitted when my main
                      > > page is submitted.
                      > >
                      > > This is easily reproducible with the dialog.html example page shipped
                      > > with yui.zip - just simply add a <form> element right inside the
                      > > <body> tag and reload the page - you'll get a JavaScript error.
                      > >
                      > > Is this misuing the library? It seems that it would be quite powerful
                      > > to be able to expose parts of your form in a dialog rather than inline
                      > > on the page, but still have only one main page form submit to worry
                      > > about...
                      > >
                      > > Thanks,
                      > >
                      > > Scott
                      > >
                      > >
                      >
                      > --
                      > Blog (XML, Web apps, Open Source):
                      > http://www.orbeon.com/blog/
                      >
                      >
                      >
                      >



                      --
                      Blog (XML, Web apps, Open Source):
                      http://www.orbeon.com/blog/
                    • Steven Peterson
                      Alex, If you don t need to use the Dialog features (the built-in form, for instance), would it make more sense for you to just work with a Panel that s
                      Message 10 of 11 , Nov 1, 2006
                      • 0 Attachment

                        Alex,

                         

                        If you don’t need to use the Dialog features (the built-in form, for instance), would it make more sense for you to just work with a Panel that’s contained within the form? Which features of Dialog are you using that are unavailable as a part of Panel?

                         

                        Thanks!

                         

                        Steven Peterson

                        Web Developer, Platform Engineering

                        Yahoo!

                         

                         

                         

                        From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
                        Sent: Wednesday, November 01, 2006 9:53 AM
                        To: ydn-javascript@yahoogroups.com
                        Subject: Re: [ydn-javascript] Cannot define Dialog div inside a <form> tag

                         

                        Hi Steven,

                        Just like Bart mentioned, placing the dialog in a div at the
                        document.body level does not work in this case. I would like the
                        dialog markup to stay inside my form, because the dialog has form
                        controls, which need to be inside my form.

                        I am well aware that this interferes with the ability of the dialog to
                        submit data to the server on its own, but for the use case I have
                        here, this is an ability that I don't need. I just want a great dialog
                        :). So in the meantime, I will keep the "return;" inserted as the
                        first statement of registerForm().

                        Alex

                        On 10/13/06, Steven Peterson <peterson@...> wrote:

                        >
                        >
                        >
                        >
                        > Alex,
                        >
                        >
                        >
                        > Like I suggested to Scott, Dialog generally should not be rendered nested
                        in another element if at all possible. You can achieve this by calling render with document.body as an argument. In that case, the Dialog will be rendered outside of the default ASP.NET form, so you shouldn't encounter this issue. The initial placement of the markup is not important, but the final place where the Dialog ends up is significant. The form currently cannot be disabled because it is relied upon by the Dialog as a container for the form elements that will ultimately be submitted to the server. However, if the markup is placed correctly, the coexistence of two forms on your page should not be a problem. It would be great if you could let me know if the render argument solves your issue, so that I'll be able to recommend it to people in the future if they encounter this issue in the future.
                        >
                        >
                        >
                        > Thanks!
                        >
                        > Steven Peterson
                        >
                        > Web Developer, Platform Engineering
                        >
                        > Yahoo!
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        > From: ydn-javascript@yahoogroups.com
                        [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
                        > Sent: Friday, October 13, 2006 6:11 PM
                        > To: ydn-javascript@yahoogroups.com
                        > Subject: Re: [ydn-javascript] Cannot define Dialog div inside a
                        <form> tag
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        > Steven,
                        >
                        > I have the same problem as Scott: I need the dialog to be inside an
                        > existing form in the page, and I don't need the library to create its
                        > own form. So for now I just added a "return;" at the beginning
                        of
                        > registerForm(), but it would be useful to be able to disable this
                        > feature, if it is not needed.
                        >
                        > Alex
                        >
                        > On 10/9/06, Steven Peterson <peterson@...>
                        wrote:
                        > >
                        > >
                        > >
                        > >
                        > > Scott,
                        > >
                        > >
                        > >
                        > > You can define your Dialog anywhere that you would like to. The key
                        is where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It's generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.
                        > >
                        > >
                        > >
                        > > Thanks!
                        > >
                        > > Steven Peterson
                        > >
                        > > Web Developer, Platform Engineering
                        > >
                        > > Yahoo!
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > > From: ydn-javascript@yahoogroups.com
                        [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
                        > > Sent: Friday, October 06, 2006 2:29 PM
                        > > To: ydn-javascript@yahoogroups.com
                        > > Subject: [ydn-javascript] Cannot define Dialog div inside a
                        <form> tag
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > > Hello,
                        > >
                        > > I'm trying to make part of my HTML form a dialog that pops up instead
                        > > of a series of textboxes on a page. However, when I load the page
                        > > with the dialog's DIV declared inside the <form> tag, I get an
                        error
                        > > saying "form has no properties" on container.js line 3234
                        (this is
                        > > 0.11.4). If I move the dialog's DIV outside, it works, but then my
                        > > inputs that are on the dialog no longer get submitted when my main
                        > > page is submitted.
                        > >
                        > > This is easily reproducible with the dialog.html example page shipped
                        > > with yui.zip - just simply add a <form> element right inside
                        the
                        > > <body> tag and reload the page - you'll get a JavaScript error.
                        > >
                        > > Is this misuing the library? It seems that it would be quite powerful
                        > > to be able to expose parts of your form in a dialog rather than
                        inline
                        > > on the page, but still have only one main page form submit to worry
                        > > about...
                        > >
                        > > Thanks,
                        > >
                        > > Scott
                        > >
                        > >
                        >
                        > --
                        > Blog (XML, Web apps, Open Source):
                        > http://www.orbeon.com/blog/
                        >
                        >
                        >
                        >

                        --
                        Blog (XML, Web apps, Open Source):
                        http://www.orbeon.com/blog/

                      • steve.klee
                        I previously posted a solution to using the Dialog embedded in an ASP.NET form. Admittedly I hacked up the YUI source but this would be easy to modify as your
                        Message 11 of 11 , Nov 1, 2006
                        • 0 Attachment
                          I previously posted a solution to using the Dialog embedded in an
                          ASP.NET form. Admittedly I hacked up the YUI source but this would be
                          easy to modify as your own sub-classed Dialog object. The link to the
                          previous post is here:

                          http://tech.groups.yahoo.com/group/ydn-javascript/message/4902

                          It allows you to tell the Dialog to use the ASP.NET form and also
                          let's you specify the first and last form element as the built-in
                          dialog does not consider anchors in its own evaluation.
                        Your message has been successfully submitted and would be delivered to recipients shortly.