html forms in aspx pages

Discussion in 'ASP .Net' started by thersitz, Jan 17, 2007.

  1. thersitz

    thersitz Guest

    I can't seem to get my html form to submit properly from within a web form.
    Here's my form tag syntax and some delivery hidden fields.
    <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    method="POST" onsubmit="return verify();">
    <input type="hidden" name="recipient" value= />
    <input type="hidden" name="redirect"
    value="http://www.xxx.org/forms/confirmation.htm" />
    ....................
    ....................
    rest of form.

    I have the form within <asp:content> tags of an asp web form page. Is that
    the problem? Do html forms need to be in a file with an html extension and
    not a web form. This web form uses a masterpage. I did try putting the html
    forms in the masterpage -- but that didn't seem to affect anything.

    The form recognizes the reset button and clears the form, but when I submit
    it simply reloads the page -- and doesn't access the delivery.cgi file nor
    send me the results nor redirect to the confirmation page.

    Thanks for any help.
    thersitz, Jan 17, 2007
    #1
    1. Advertising

  2. thersitz

    David Wier Guest

    When you say you can't get it to submit properly - what exactly do you mean
    (what happens)?

    I've never tried the 'old' way of doing forms in a content page, so I'm not
    exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
    instead - I do that all the time and it works fine....

    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://aspexpress.com


    "thersitz" <> wrote in message
    news:...
    > I can't seem to get my html form to submit properly from within a web

    form.
    > Here's my form tag syntax and some delivery hidden fields.
    > <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    > method="POST" onsubmit="return verify();">
    > <input type="hidden" name="recipient" value= />
    > <input type="hidden" name="redirect"
    > value="http://www.xxx.org/forms/confirmation.htm" />
    > ...................
    > ...................
    > rest of form.
    >
    > I have the form within <asp:content> tags of an asp web form page. Is that
    > the problem? Do html forms need to be in a file with an html extension and
    > not a web form. This web form uses a masterpage. I did try putting the

    html
    > forms in the masterpage -- but that didn't seem to affect anything.
    >
    > The form recognizes the reset button and clears the form, but when I

    submit
    > it simply reloads the page -- and doesn't access the delivery.cgi file nor
    > send me the results nor redirect to the confirmation page.
    >
    > Thanks for any help.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    David Wier, Jan 17, 2007
    #2
    1. Advertising

  3. You can't nest HTML forms inside each other.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Bit Player
    http://unclechutney.blogspot.com

    In case of Minimalism, break Philip Glass.

    "thersitz" <> wrote in message
    news:...
    >I can't seem to get my html form to submit properly from within a web form.
    >Here's my form tag syntax and some delivery hidden fields.
    > <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    > method="POST" onsubmit="return verify();">
    > <input type="hidden" name="recipient" value= />
    > <input type="hidden" name="redirect"
    > value="http://www.xxx.org/forms/confirmation.htm" />
    > ...................
    > ...................
    > rest of form.
    >
    > I have the form within <asp:content> tags of an asp web form page. Is that
    > the problem? Do html forms need to be in a file with an html extension and
    > not a web form. This web form uses a masterpage. I did try putting the
    > html forms in the masterpage -- but that didn't seem to affect anything.
    >
    > The form recognizes the reset button and clears the form, but when I
    > submit it simply reloads the page -- and doesn't access the delivery.cgi
    > file nor send me the results nor redirect to the confirmation page.
    >
    > Thanks for any help.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    Kevin Spencer, Jan 17, 2007
    #3
  4. thersitz

    thersitz Guest

    Thanks David. I am really new to asp.net, and feel I am drowning.

    Well, my action attribute is suppose to go to this
    <action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
    read and then delivered and then send the user to a confirmation page. All
    that happens in my aspx file is that the page reloads and nothing seems to
    get sent anywhere.

    I tried using the asp.net controls to build the form -- and still use the
    delivery.cgi to parse it -- but then I was getting post back errors.

    If I build the form using all asp.net controls -- and not use any regular
    html form tags -- how do I get it to deliver say an email to a set of
    recipients?

    I appropriately have an asp for dummies book and it seems to suggest just
    using html form tags -- and when doing so, the page builds fine and displays
    fine. The reset button clears the form. But submitting just reloads the very
    same page instead of routing to the cgi file handler.



    "David Wier" <> wrote in message
    news:uzZ0r%...
    > When you say you can't get it to submit properly - what exactly do you
    > mean
    > (what happens)?
    >
    > I've never tried the 'old' way of doing forms in a content page, so I'm
    > not
    > exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
    > instead - I do that all the time and it works fine....
    >
    > --
    > David Wier
    > MVP/ASPInsider
    > http://aspnet101.com
    > http://aspexpress.com
    >
    >
    > "thersitz" <> wrote in message
    > news:...
    >> I can't seem to get my html form to submit properly from within a web

    > form.
    >> Here's my form tag syntax and some delivery hidden fields.
    >> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    >> method="POST" onsubmit="return verify();">
    >> <input type="hidden" name="recipient" value= />
    >> <input type="hidden" name="redirect"
    >> value="http://www.xxx.org/forms/confirmation.htm" />
    >> ...................
    >> ...................
    >> rest of form.
    >>
    >> I have the form within <asp:content> tags of an asp web form page. Is
    >> that
    >> the problem? Do html forms need to be in a file with an html extension
    >> and
    >> not a web form. This web form uses a masterpage. I did try putting the

    > html
    >> forms in the masterpage -- but that didn't seem to affect anything.
    >>
    >> The form recognizes the reset button and clears the form, but when I

    > submit
    >> it simply reloads the page -- and doesn't access the delivery.cgi file
    >> nor
    >> send me the results nor redirect to the confirmation page.
    >>
    >> Thanks for any help.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >
    >
    thersitz, Jan 17, 2007
    #4
  5. thersitz

    David Wier Guest

    The problem here, is the form deal, as Kevin pointed out - - - (doah! -
    wasn't thinking clearly enough)
    The way this is normally done is creating the form itself (without the form
    tags), and then adding a button. Then, inside the button's click event, you
    create everything that you need done with the form.
    Not totally sure, again, with the cgi aspect of this - but check out this
    sample on crosspage posting and see if you can get it started that way:
    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/tipstricks/default.aspx#crosspage



    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://aspexpress.com



    "thersitz" <> wrote in message
    news:...
    > Thanks David. I am really new to asp.net, and feel I am drowning.
    >
    > Well, my action attribute is suppose to go to this
    > <action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
    > read and then delivered and then send the user to a confirmation page. All
    > that happens in my aspx file is that the page reloads and nothing seems to
    > get sent anywhere.
    >
    > I tried using the asp.net controls to build the form -- and still use the
    > delivery.cgi to parse it -- but then I was getting post back errors.
    >
    > If I build the form using all asp.net controls -- and not use any regular
    > html form tags -- how do I get it to deliver say an email to a set of
    > recipients?
    >
    > I appropriately have an asp for dummies book and it seems to suggest just
    > using html form tags -- and when doing so, the page builds fine and

    displays
    > fine. The reset button clears the form. But submitting just reloads the

    very
    > same page instead of routing to the cgi file handler.
    >
    >
    >
    > "David Wier" <> wrote in message
    > news:uzZ0r%...
    > > When you say you can't get it to submit properly - what exactly do you
    > > mean
    > > (what happens)?
    > >
    > > I've never tried the 'old' way of doing forms in a content page, so I'm
    > > not
    > > exactly sure what to expect - but I'd suggest writing it the ASP.Net

    way,
    > > instead - I do that all the time and it works fine....
    > >
    > > --
    > > David Wier
    > > MVP/ASPInsider
    > > http://aspnet101.com
    > > http://aspexpress.com
    > >
    > >
    > > "thersitz" <> wrote in message
    > > news:...
    > >> I can't seem to get my html form to submit properly from within a web

    > > form.
    > >> Here's my form tag syntax and some delivery hidden fields.
    > >> <form id="myForm"

    action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    > >> method="POST" onsubmit="return verify();">
    > >> <input type="hidden" name="recipient" value= />
    > >> <input type="hidden" name="redirect"
    > >> value="http://www.xxx.org/forms/confirmation.htm" />
    > >> ...................
    > >> ...................
    > >> rest of form.
    > >>
    > >> I have the form within <asp:content> tags of an asp web form page. Is
    > >> that
    > >> the problem? Do html forms need to be in a file with an html extension
    > >> and
    > >> not a web form. This web form uses a masterpage. I did try putting the

    > > html
    > >> forms in the masterpage -- but that didn't seem to affect anything.
    > >>
    > >> The form recognizes the reset button and clears the form, but when I

    > > submit
    > >> it simply reloads the page -- and doesn't access the delivery.cgi file
    > >> nor
    > >> send me the results nor redirect to the confirmation page.
    > >>
    > >> Thanks for any help.
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>

    > >
    > >

    >
    >
    David Wier, Jan 17, 2007
    #5
  6. thersitz

    thersitz Guest

    Yes it does. Thanks, Kevin.

    Could I do this in my masterpage:
    <form id="form1" runat="server"
    action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">

    And then build a web form linking that masterpage and when submitting have
    the server send the results to the cgi file cited so that the cgi file
    parses and delivers -- like my other html forms?


    "Kevin Spencer" <> wrote in message
    news:...
    > You can't nest HTML forms inside each other.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Bit Player
    > http://unclechutney.blogspot.com
    >
    > In case of Minimalism, break Philip Glass.
    >
    > "thersitz" <> wrote in message
    > news:...
    >>I can't seem to get my html form to submit properly from within a web
    >>form. Here's my form tag syntax and some delivery hidden fields.
    >> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    >> method="POST" onsubmit="return verify();">
    >> <input type="hidden" name="recipient" value= />
    >> <input type="hidden" name="redirect"
    >> value="http://www.xxx.org/forms/confirmation.htm" />
    >> ...................
    >> ...................
    >> rest of form.
    >>
    >> I have the form within <asp:content> tags of an asp web form page. Is
    >> that the problem? Do html forms need to be in a file with an html
    >> extension and not a web form. This web form uses a masterpage. I did try
    >> putting the html forms in the masterpage -- but that didn't seem to
    >> affect anything.
    >>
    >> The form recognizes the reset button and clears the form, but when I
    >> submit it simply reloads the page -- and doesn't access the delivery.cgi
    >> file nor send me the results nor redirect to the confirmation page.
    >>
    >> Thanks for any help.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >
    >
    thersitz, Jan 17, 2007
    #6
  7. Another method is to put the "regular" HTML form outside the WebForm
    (outside of the <form...>...</form> tags) in the ASP.Net page. Of course,
    you would have to change your method of adding the "plain HTML" form code, a
    server-side include, for example.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Bit Player
    http://unclechutney.blogspot.com

    In case of Minimalism, break Philip Glass.

    "David Wier" <> wrote in message
    news:...
    > The problem here, is the form deal, as Kevin pointed out - - - (doah! -
    > wasn't thinking clearly enough)
    > The way this is normally done is creating the form itself (without the
    > form
    > tags), and then adding a button. Then, inside the button's click event,
    > you
    > create everything that you need done with the form.
    > Not totally sure, again, with the cgi aspect of this - but check out this
    > sample on crosspage posting and see if you can get it started that way:
    > http://quickstarts.asp.net/QuickStartv20/aspnet/doc/tipstricks/default.aspx#crosspage
    >
    >
    >
    > --
    > David Wier
    > MVP/ASPInsider
    > http://aspnet101.com
    > http://aspexpress.com
    >
    >
    >
    > "thersitz" <> wrote in message
    > news:...
    >> Thanks David. I am really new to asp.net, and feel I am drowning.
    >>
    >> Well, my action attribute is suppose to go to this
    >> <action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and
    >> get
    >> read and then delivered and then send the user to a confirmation page.
    >> All
    >> that happens in my aspx file is that the page reloads and nothing seems
    >> to
    >> get sent anywhere.
    >>
    >> I tried using the asp.net controls to build the form -- and still use the
    >> delivery.cgi to parse it -- but then I was getting post back errors.
    >>
    >> If I build the form using all asp.net controls -- and not use any
    >> regular
    >> html form tags -- how do I get it to deliver say an email to a set of
    >> recipients?
    >>
    >> I appropriately have an asp for dummies book and it seems to suggest just
    >> using html form tags -- and when doing so, the page builds fine and

    > displays
    >> fine. The reset button clears the form. But submitting just reloads the

    > very
    >> same page instead of routing to the cgi file handler.
    >>
    >>
    >>
    >> "David Wier" <> wrote in message
    >> news:uzZ0r%...
    >> > When you say you can't get it to submit properly - what exactly do you
    >> > mean
    >> > (what happens)?
    >> >
    >> > I've never tried the 'old' way of doing forms in a content page, so I'm
    >> > not
    >> > exactly sure what to expect - but I'd suggest writing it the ASP.Net

    > way,
    >> > instead - I do that all the time and it works fine....
    >> >
    >> > --
    >> > David Wier
    >> > MVP/ASPInsider
    >> > http://aspnet101.com
    >> > http://aspexpress.com
    >> >
    >> >
    >> > "thersitz" <> wrote in message
    >> > news:...
    >> >> I can't seem to get my html form to submit properly from within a web
    >> > form.
    >> >> Here's my form tag syntax and some delivery hidden fields.
    >> >> <form id="myForm"

    > action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
    >> >> method="POST" onsubmit="return verify();">
    >> >> <input type="hidden" name="recipient" value= />
    >> >> <input type="hidden" name="redirect"
    >> >> value="http://www.xxx.org/forms/confirmation.htm" />
    >> >> ...................
    >> >> ...................
    >> >> rest of form.
    >> >>
    >> >> I have the form within <asp:content> tags of an asp web form page. Is
    >> >> that
    >> >> the problem? Do html forms need to be in a file with an html extension
    >> >> and
    >> >> not a web form. This web form uses a masterpage. I did try putting the
    >> > html
    >> >> forms in the masterpage -- but that didn't seem to affect anything.
    >> >>
    >> >> The form recognizes the reset button and clears the form, but when I
    >> > submit
    >> >> it simply reloads the page -- and doesn't access the delivery.cgi file
    >> >> nor
    >> >> send me the results nor redirect to the confirmation page.
    >> >>
    >> >> Thanks for any help.
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Kevin Spencer, Jan 18, 2007
    #7
  8. I just gave you a suggestion in another post in this same thread. See if you
    like it. The important thing to remember is that a WebForm is, on the client
    side, an HTML form, and you can't nest HTML forms inside one another. How
    you work around that is up to you, but I did make a suggestion.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Bit Player
    http://unclechutney.blogspot.com

    In case of Minimalism, break Philip Glass.

    "thersitz" <> wrote in message
    news:...
    > Yes it does. Thanks, Kevin.
    >
    > Could I do this in my masterpage:
    > <form id="form1" runat="server"
    > action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">
    >
    > And then build a web form linking that masterpage and when submitting have
    > the server send the results to the cgi file cited so that the cgi file
    > parses and delivers -- like my other html forms?
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    >> You can't nest HTML forms inside each other.
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> Bit Player
    >> http://unclechutney.blogspot.com
    >>
    >> In case of Minimalism, break Philip Glass.
    >>
    >> "thersitz" <> wrote in message
    >> news:...
    >>>I can't seem to get my html form to submit properly from within a web
    >>>form. Here's my form tag syntax and some delivery hidden fields.
    >>> <form id="myForm"
    >>> action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi" method="POST"
    >>> onsubmit="return verify();">
    >>> <input type="hidden" name="recipient" value= />
    >>> <input type="hidden" name="redirect"
    >>> value="http://www.xxx.org/forms/confirmation.htm" />
    >>> ...................
    >>> ...................
    >>> rest of form.
    >>>
    >>> I have the form within <asp:content> tags of an asp web form page. Is
    >>> that the problem? Do html forms need to be in a file with an html
    >>> extension and not a web form. This web form uses a masterpage. I did try
    >>> putting the html forms in the masterpage -- but that didn't seem to
    >>> affect anything.
    >>>
    >>> The form recognizes the reset button and clears the form, but when I
    >>> submit it simply reloads the page -- and doesn't access the delivery.cgi
    >>> file nor send me the results nor redirect to the confirmation page.
    >>>
    >>> Thanks for any help.
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
    Kevin Spencer, Jan 18, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=

    How to rise aspx parent forms event from aspx Child form

    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    874
    S. Justin Gengo
    Oct 22, 2005
  2. Replies:
    1
    Views:
    655
    Kevin Spencer
    Oct 31, 2006
  3. Jeremy Chapman

    migrating aspx forms app to mobile forms

    Jeremy Chapman, Jun 15, 2006, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    727
    Christoph Richter [AT]
    Jun 18, 2006
  4. Eric
    Replies:
    2
    Views:
    466
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,188
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page