5 Replies Latest reply on Jul 29, 2008 8:59 AM by Newsgroup_User

    Need help with Form Validation using If conditions

    Level 7
      I have a page that has 2 forms on it.. and based on a selection make on the
      previous page, they see the correct form needed.

      My problem is that one of the forms is doing nothing but displaying their
      selections from the previous page and only option is to submit the form..
      the other form requires name and email to be completed to be sent along with
      the other data that is dsiplayed on the screen.

      Since i have 2 forms on the page and each form is being displayed based on a
      value passed from the previous page... how can i setup the validation to
      fall under that same if condition?

      I tried using the same if condition wrapped around the validation code, but
      it still lets the form post without any data in the fields

      Any suggestions? any sites available that may explain this?

      Each form has its own name, i tried the standard form validation within
      dreamweaver and also the WA Validation ToolKit and i cant seem to get this..
      can this be done? If so maybe im wrapping the wrong things in the
      conditions..
      i did notice that with the WA validation, it acknowledges the different
      forms and i can pick the proper fields, but still nothing.


      thanks in advance


      --
      ************************************************
      ASP, SQL2005, DW8 VBScript, Access


        • 1. Re: Need help with Form Validation using If conditions
          Level 7
          Have two forms on the page. each one has its own SUBMIT button. Use the
          value passed from the previous page to determine which <form> tag gets -

          style="display:none"

          added inline.

          Use the validation tool to validate each form's submission. It should work
          like melted buttah.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "Daniel" <dan_c@h.com> wrote in message
          news:g6lvcl$fjd$1@forums.macromedia.com...
          >I have a page that has 2 forms on it.. and based on a selection make on the
          >previous page, they see the correct form needed.
          >
          > My problem is that one of the forms is doing nothing but displaying their
          > selections from the previous page and only option is to submit the form..
          > the other form requires name and email to be completed to be sent along
          > with the other data that is dsiplayed on the screen.
          >
          > Since i have 2 forms on the page and each form is being displayed based on
          > a value passed from the previous page... how can i setup the validation to
          > fall under that same if condition?
          >
          > I tried using the same if condition wrapped around the validation code,
          > but it still lets the form post without any data in the fields
          >
          > Any suggestions? any sites available that may explain this?
          >
          > Each form has its own name, i tried the standard form validation within
          > dreamweaver and also the WA Validation ToolKit and i cant seem to get
          > this.. can this be done? If so maybe im wrapping the wrong things in the
          > conditions..
          > i did notice that with the WA validation, it acknowledges the different
          > forms and i can pick the proper fields, but still nothing.
          >
          >
          > thanks in advance
          >
          >
          > --
          > ************************************************
          > ASP, SQL2005, DW8 VBScript, Access
          >

          • 2. Re: Need help with Form Validation using If conditions
            Level 7
            Thanks for the reply, but where should i apply that style?
            here are my form tags and if conditions. ( no need to post all of the form )

            <% If Request.Form("payment")= "P" Then %>
            <form target="mypay" action=https://mypayment.com/ method="post"
            name="payp" >

            <% Else %>
            <form action="email.asp" method="post" name="email" >


            Should i be more specific with the If Request for the 2nd form like this?
            <% If Request.Form("pay")= "P" Then %>
            <form target="mypay" action=https://mypayment.com/ method="post"
            name="payp" >
            <% End If %>
            <% If Request.Form("pay")= "E" Then %>
            <form action="email.asp" method="post" name="email" >
            <% End If %>


            --
            ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
            "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
            news:g6mvrt$j5i$1@forums.macromedia.com...
            > Have two forms on the page. each one has its own SUBMIT button. Use the
            > value passed from the previous page to determine which <form> tag gets -
            >
            > style="display:none"
            >
            > added inline.
            >
            > Use the validation tool to validate each form's submission. It should
            > work like melted buttah.
            >
            > --
            > Murray --- ICQ 71997575
            > Adobe Community Expert
            > (If you *MUST* email me, don't LAUGH when you do so!)
            > ==================
            > http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            > http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            > ==================
            >
            >
            > "Daniel" <dan_c@h.com> wrote in message
            > news:g6lvcl$fjd$1@forums.macromedia.com...
            >>I have a page that has 2 forms on it.. and based on a selection make on
            >>the previous page, they see the correct form needed.
            >>
            >> My problem is that one of the forms is doing nothing but displaying their
            >> selections from the previous page and only option is to submit the form..
            >> the other form requires name and email to be completed to be sent along
            >> with the other data that is dsiplayed on the screen.
            >>
            >> Since i have 2 forms on the page and each form is being displayed based
            >> on a value passed from the previous page... how can i setup the
            >> validation to fall under that same if condition?
            >>
            >> I tried using the same if condition wrapped around the validation code,
            >> but it still lets the form post without any data in the fields
            >>
            >> Any suggestions? any sites available that may explain this?
            >>
            >> Each form has its own name, i tried the standard form validation within
            >> dreamweaver and also the WA Validation ToolKit and i cant seem to get
            >> this.. can this be done? If so maybe im wrapping the wrong things in the
            >> conditions..
            >> i did notice that with the WA validation, it acknowledges the different
            >> forms and i can pick the proper fields, but still nothing.
            >>
            >>
            >> thanks in advance
            >>
            >>
            >> --
            >> ************************************************
            >> ASP, SQL2005, DW8 VBScript, Access
            >>
            >


            • 3. Re: Need help with Form Validation using If conditions
              Level 7
              So let me understand - the ELEMENTS within the form are the same? The only
              difference between the two forms is the form tag itself? If that's the
              case, I think you should take a different approach.

              The page would have a single form on it. Use your logic to rewrite the
              action attribute, e.g.,

              <form <% if Request.Form("payment")= "P" then response.write('target="mypay"
              action=https://mypayment.com/') else response.write(' action="email.asp"')
              %> method="post" name="paypEmail" >


              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              ==================


              "Daniel" <dan_c@h.com> wrote in message
              news:g6naoe$14h$1@forums.macromedia.com...
              > Thanks for the reply, but where should i apply that style?
              > here are my form tags and if conditions. ( no need to post all of the
              > form )
              >
              > <% If Request.Form("payment")= "P" Then %>
              > <form target="mypay" action=https://mypayment.com/ method="post"
              > name="payp" >
              >
              > <% Else %>
              > <form action="email.asp" method="post" name="email" >
              >
              >
              > Should i be more specific with the If Request for the 2nd form like this?
              > <% If Request.Form("pay")= "P" Then %>
              > <form target="mypay" action=https://mypayment.com/ method="post"
              > name="payp" >
              > <% End If %>
              > <% If Request.Form("pay")= "E" Then %>
              > <form action="email.asp" method="post" name="email" >
              > <% End If %>
              >
              >
              > --
              > ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
              > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
              > news:g6mvrt$j5i$1@forums.macromedia.com...
              >> Have two forms on the page. each one has its own SUBMIT button. Use the
              >> value passed from the previous page to determine which <form> tag gets -
              >>
              >> style="display:none"
              >>
              >> added inline.
              >>
              >> Use the validation tool to validate each form's submission. It should
              >> work like melted buttah.
              >>
              >> --
              >> Murray --- ICQ 71997575
              >> Adobe Community Expert
              >> (If you *MUST* email me, don't LAUGH when you do so!)
              >> ==================
              >> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              >> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              >> ==================
              >>
              >>
              >> "Daniel" <dan_c@h.com> wrote in message
              >> news:g6lvcl$fjd$1@forums.macromedia.com...
              >>>I have a page that has 2 forms on it.. and based on a selection make on
              >>>the previous page, they see the correct form needed.
              >>>
              >>> My problem is that one of the forms is doing nothing but displaying
              >>> their selections from the previous page and only option is to submit the
              >>> form..
              >>> the other form requires name and email to be completed to be sent along
              >>> with the other data that is dsiplayed on the screen.
              >>>
              >>> Since i have 2 forms on the page and each form is being displayed based
              >>> on a value passed from the previous page... how can i setup the
              >>> validation to fall under that same if condition?
              >>>
              >>> I tried using the same if condition wrapped around the validation code,
              >>> but it still lets the form post without any data in the fields
              >>>
              >>> Any suggestions? any sites available that may explain this?
              >>>
              >>> Each form has its own name, i tried the standard form validation within
              >>> dreamweaver and also the WA Validation ToolKit and i cant seem to get
              >>> this.. can this be done? If so maybe im wrapping the wrong things in the
              >>> conditions..
              >>> i did notice that with the WA validation, it acknowledges the different
              >>> forms and i can pick the proper fields, but still nothing.
              >>>
              >>>
              >>> thanks in advance
              >>>
              >>>
              >>> --
              >>> ************************************************
              >>> ASP, SQL2005, DW8 VBScript, Access
              >>>
              >>
              >
              >

              • 4. Re: Need help with Form Validation using If conditions
                Level 7
                they have a few different elements.. because of the process each has to go
                thru..

                i guess i can make them both the same and pass the fields on need based on
                the logic

                --
                ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
                "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                news:g6nbgb$1rl$1@forums.macromedia.com...
                > So let me understand - the ELEMENTS within the form are the same? The
                > only difference between the two forms is the form tag itself? If that's
                > the case, I think you should take a different approach.
                >
                > The page would have a single form on it. Use your logic to rewrite the
                > action attribute, e.g.,
                >
                > <form <% if Request.Form("payment")= "P" then
                > response.write('target="mypay" action=https://mypayment.com/') else
                > response.write(' action="email.asp"') %> method="post" name="paypEmail" >
                >
                >
                > --
                > Murray --- ICQ 71997575
                > Adobe Community Expert
                > (If you *MUST* email me, don't LAUGH when you do so!)
                > ==================
                > http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                > http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                > ==================
                >
                >
                > "Daniel" <dan_c@h.com> wrote in message
                > news:g6naoe$14h$1@forums.macromedia.com...
                >> Thanks for the reply, but where should i apply that style?
                >> here are my form tags and if conditions. ( no need to post all of the
                >> form )
                >>
                >> <% If Request.Form("payment")= "P" Then %>
                >> <form target="mypay" action=https://mypayment.com/ method="post"
                >> name="payp" >
                >>
                >> <% Else %>
                >> <form action="email.asp" method="post" name="email" >
                >>
                >>
                >> Should i be more specific with the If Request for the 2nd form like this?
                >> <% If Request.Form("pay")= "P" Then %>
                >> <form target="mypay" action=https://mypayment.com/ method="post"
                >> name="payp" >
                >> <% End If %>
                >> <% If Request.Form("pay")= "E" Then %>
                >> <form action="email.asp" method="post" name="email" >
                >> <% End If %>
                >>
                >>
                >> --
                >> ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
                >> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                >> news:g6mvrt$j5i$1@forums.macromedia.com...
                >>> Have two forms on the page. each one has its own SUBMIT button. Use
                >>> the value passed from the previous page to determine which <form> tag
                >>> gets -
                >>>
                >>> style="display:none"
                >>>
                >>> added inline.
                >>>
                >>> Use the validation tool to validate each form's submission. It should
                >>> work like melted buttah.
                >>>
                >>> --
                >>> Murray --- ICQ 71997575
                >>> Adobe Community Expert
                >>> (If you *MUST* email me, don't LAUGH when you do so!)
                >>> ==================
                >>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                >>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                >>> ==================
                >>>
                >>>
                >>> "Daniel" <dan_c@h.com> wrote in message
                >>> news:g6lvcl$fjd$1@forums.macromedia.com...
                >>>>I have a page that has 2 forms on it.. and based on a selection make on
                >>>>the previous page, they see the correct form needed.
                >>>>
                >>>> My problem is that one of the forms is doing nothing but displaying
                >>>> their selections from the previous page and only option is to submit
                >>>> the form..
                >>>> the other form requires name and email to be completed to be sent along
                >>>> with the other data that is dsiplayed on the screen.
                >>>>
                >>>> Since i have 2 forms on the page and each form is being displayed based
                >>>> on a value passed from the previous page... how can i setup the
                >>>> validation to fall under that same if condition?
                >>>>
                >>>> I tried using the same if condition wrapped around the validation code,
                >>>> but it still lets the form post without any data in the fields
                >>>>
                >>>> Any suggestions? any sites available that may explain this?
                >>>>
                >>>> Each form has its own name, i tried the standard form validation within
                >>>> dreamweaver and also the WA Validation ToolKit and i cant seem to get
                >>>> this.. can this be done? If so maybe im wrapping the wrong things in
                >>>> the conditions..
                >>>> i did notice that with the WA validation, it acknowledges the different
                >>>> forms and i can pick the proper fields, but still nothing.
                >>>>
                >>>>
                >>>> thanks in advance
                >>>>
                >>>>
                >>>> --
                >>>> ************************************************
                >>>> ASP, SQL2005, DW8 VBScript, Access
                >>>>
                >>>
                >>
                >>
                >


                • 5. Re: Need help with Form Validation using If conditions
                  Level 7
                  That could work.

                  --
                  Murray --- ICQ 71997575
                  Adobe Community Expert
                  (If you *MUST* email me, don't LAUGH when you do so!)
                  ==================
                  http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  ==================


                  "Daniel" <dan_c@h.com> wrote in message
                  news:g6ndjk$4ei$1@forums.macromedia.com...
                  > they have a few different elements.. because of the process each has to go
                  > thru..
                  >
                  > i guess i can make them both the same and pass the fields on need based on
                  > the logic
                  >
                  > --
                  > ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
                  > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                  > news:g6nbgb$1rl$1@forums.macromedia.com...
                  >> So let me understand - the ELEMENTS within the form are the same? The
                  >> only difference between the two forms is the form tag itself? If that's
                  >> the case, I think you should take a different approach.
                  >>
                  >> The page would have a single form on it. Use your logic to rewrite the
                  >> action attribute, e.g.,
                  >>
                  >> <form <% if Request.Form("payment")= "P" then
                  >> response.write('target="mypay" action=https://mypayment.com/') else
                  >> response.write(' action="email.asp"') %> method="post" name="paypEmail"
                  >> >
                  >>
                  >>
                  >> --
                  >> Murray --- ICQ 71997575
                  >> Adobe Community Expert
                  >> (If you *MUST* email me, don't LAUGH when you do so!)
                  >> ==================
                  >> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  >> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  >> ==================
                  >>
                  >>
                  >> "Daniel" <dan_c@h.com> wrote in message
                  >> news:g6naoe$14h$1@forums.macromedia.com...
                  >>> Thanks for the reply, but where should i apply that style?
                  >>> here are my form tags and if conditions. ( no need to post all of the
                  >>> form )
                  >>>
                  >>> <% If Request.Form("payment")= "P" Then %>
                  >>> <form target="mypay" action=https://mypayment.com/ method="post"
                  >>> name="payp" >
                  >>>
                  >>> <% Else %>
                  >>> <form action="email.asp" method="post" name="email" >
                  >>>
                  >>>
                  >>> Should i be more specific with the If Request for the 2nd form like
                  >>> this?
                  >>> <% If Request.Form("pay")= "P" Then %>
                  >>> <form target="mypay" action=https://mypayment.com/ method="post"
                  >>> name="payp" >
                  >>> <% End If %>
                  >>> <% If Request.Form("pay")= "E" Then %>
                  >>> <form action="email.asp" method="post" name="email" >
                  >>> <% End If %>
                  >>>
                  >>>
                  >>> --
                  >>> ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008
                  >>> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                  >>> news:g6mvrt$j5i$1@forums.macromedia.com...
                  >>>> Have two forms on the page. each one has its own SUBMIT button. Use
                  >>>> the value passed from the previous page to determine which <form> tag
                  >>>> gets -
                  >>>>
                  >>>> style="display:none"
                  >>>>
                  >>>> added inline.
                  >>>>
                  >>>> Use the validation tool to validate each form's submission. It should
                  >>>> work like melted buttah.
                  >>>>
                  >>>> --
                  >>>> Murray --- ICQ 71997575
                  >>>> Adobe Community Expert
                  >>>> (If you *MUST* email me, don't LAUGH when you do so!)
                  >>>> ==================
                  >>>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  >>>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  >>>> ==================
                  >>>>
                  >>>>
                  >>>> "Daniel" <dan_c@h.com> wrote in message
                  >>>> news:g6lvcl$fjd$1@forums.macromedia.com...
                  >>>>>I have a page that has 2 forms on it.. and based on a selection make on
                  >>>>>the previous page, they see the correct form needed.
                  >>>>>
                  >>>>> My problem is that one of the forms is doing nothing but displaying
                  >>>>> their selections from the previous page and only option is to submit
                  >>>>> the form..
                  >>>>> the other form requires name and email to be completed to be sent
                  >>>>> along with the other data that is dsiplayed on the screen.
                  >>>>>
                  >>>>> Since i have 2 forms on the page and each form is being displayed
                  >>>>> based on a value passed from the previous page... how can i setup the
                  >>>>> validation to fall under that same if condition?
                  >>>>>
                  >>>>> I tried using the same if condition wrapped around the validation
                  >>>>> code, but it still lets the form post without any data in the fields
                  >>>>>
                  >>>>> Any suggestions? any sites available that may explain this?
                  >>>>>
                  >>>>> Each form has its own name, i tried the standard form validation
                  >>>>> within dreamweaver and also the WA Validation ToolKit and i cant seem
                  >>>>> to get this.. can this be done? If so maybe im wrapping the wrong
                  >>>>> things in the conditions..
                  >>>>> i did notice that with the WA validation, it acknowledges the
                  >>>>> different forms and i can pick the proper fields, but still nothing.
                  >>>>>
                  >>>>>
                  >>>>> thanks in advance
                  >>>>>
                  >>>>>
                  >>>>> --
                  >>>>> ************************************************
                  >>>>> ASP, SQL2005, DW8 VBScript, Access
                  >>>>>
                  >>>>
                  >>>
                  >>>
                  >>
                  >
                  >