Restrict selection on form - How?

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

    Restrict selection on form - How?

    I have a client that wants me to create a form that will contain about 50
    condo listings. He wants me to place a restriction on the form as to the
    number of Condo listings a user can select/request. Is that possible? If so,
    what will I need to do or use to make this stunt possible?

    The items on each page would be different. The data is being passed between
    three pages.

    Lets say on page1 there are condos available (20) located in area A. On
    page2 there are condos available (15) located in area B. On page3 there are
    condos available (15) located in area C.

    The user goes to page2 sees a condo that he/she would like information
    about. They select that condo.

    The user has now selected -one- condo from page2.

    If the user goes to page 1 or 3 and selects a condo from those pages when
    the user hits the Submit button, the program should not allow the page(s) to
    submit since the user has selected more than one condo. How can that be
    done?

    Thanks!


  • Jukka K. Korpela

    #2
    Re: Restrict selection on form - How?

    "Terabyte" <terabyte@roger s.com> wrote:
    [color=blue]
    > I have a client that wants me to create a form that will contain
    > about 50 condo listings. He wants me to place a restriction on the
    > form as to the number of Condo listings a user can select/request.
    > Is that possible?[/color]

    Not in HTML.

    The form handler can impose any restrictions you like.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

    Comment

    • Terabyte

      #3
      Re: Restrict selection on form - How?


      "Jukka K. Korpela" <jkorpela@cs.tu t.fi> wrote in message
      news:Xns949EDFB E94A91jkorpelac stutfi@193.229. 0.31...[color=blue]
      > Not in HTML.
      >
      > The form handler can impose any restrictions you like.
      >[/color]
      Thank you for replying!
      Are you talking about using forms? If not what are form handlers?

      Elton


      Comment

      • Jukka K. Korpela

        #4
        Re: Restrict selection on form - How?

        "Terabyte" <terabyte@roger s.com> wrote:
        [color=blue]
        > Are you talking about using forms?[/color]

        Yes. Aren't you?
        [color=blue]
        > If not what are form handlers?[/color]

        If you don't know what form handlers are, you won't have much chances
        of doing anything useful with forms.

        --
        Yucca, http://www.cs.tut.fi/~jkorpela/
        Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

        Comment

        • Terabyte

          #5
          Re: Restrict selection on form - How?

          I just realized what a form handler is.

          Thanks!


          Comment

          • Harlan Messinger

            #6
            Re: Restrict selection on form - How?


            "Terabyte" <terabyte@roger s.com> wrote in message
            news:B160c.4907 4$Qg7.38939@new s04.bloor.is.ne t.cable.rogers. com...[color=blue]
            > I have a client that wants me to create a form that will contain about 50
            > condo listings. He wants me to place a restriction on the form as to the
            > number of Condo listings a user can select/request. Is that possible? If[/color]
            so,[color=blue]
            > what will I need to do or use to make this stunt possible?
            >
            > The items on each page would be different. The data is being passed[/color]
            between[color=blue]
            > three pages.
            >
            > Lets say on page1 there are condos available (20) located in area A. On
            > page2 there are condos available (15) located in area B. On page3 there[/color]
            are[color=blue]
            > condos available (15) located in area C.
            >
            > The user goes to page2 sees a condo that he/she would like information
            > about. They select that condo.
            >
            > The user has now selected -one- condo from page2.
            >
            > If the user goes to page 1 or 3 and selects a condo from those pages when
            > the user hits the Submit button, the program should not allow the page(s)[/color]
            to[color=blue]
            > submit since the user has selected more than one condo. How can that be
            > done?[/color]

            Don't prevent the page from submitting. The back end is where you're keeping
            track of items that have been selected so far. When the user submits the
            final form, if there are too many selected items, send back a page that says
            so, and let the user remove some choices.

            Comment

            • Terabyte

              #7
              Re: Restrict selection on form - How?


              "Harlan Messinger" <h.messinger@co mcast.net> wrote in message
              news:c256st$1l5 qte$1@ID-114100.news.uni-berlin.de...[color=blue]
              >
              > Don't prevent the page from submitting. The back end is where you're[/color]
              keeping[color=blue]
              > track of items that have been selected so far. When the user submits the
              > final form, if there are too many selected items, send back a page that[/color]
              says[color=blue]
              > so, and let the user remove some choices.
              >[/color]
              Thank you Harlan for your suggestion!

              I discovered that the only way I can keep a user from selecting more than
              one item is by creating and maintaining a database, one where the user would
              have to login and the database program would keep tabs as to how many items
              the user has selected. In this case it is not worth building it. Sadly this
              is the only way to restrict the number of selections a user can make.

              Using cookies, radio buttons or JavaScript won't stop someone who is
              determine to select additional items. If the application is using cookies
              the user can just delete his/her cookies and start the selection process
              again. If the application is using radio buttons that will keep the user
              from selecting more than one item but once the form has been submitted, they
              can select another item and submit again. The same holds true if you are
              using JavaScript to track the number of items being selected.

              Cheers!


              Comment

              • Terabyte

                #8
                Re: Restrict selection on form - How?


                "Jukka K. Korpela" <jkorpela@cs.tu t.fi> wrote in message
                news:Xns94A1BFD BCD7A6jkorpelac stutfi@193.229. 0.31...[color=blue]
                >
                > If you don't know what form handlers are, you won't have much chances
                > of doing anything useful with forms.[/color]

                Brain death kicks in when I least expect it! You are correct if I don't know
                what form handlers are I might as well close my computer and go bowling. ;~)


                Comment

                • Harlan Messinger

                  #9
                  Re: Restrict selection on form - How?

                  "Terabyte" <terabyte@roger s.com> wrote:
                  [color=blue]
                  >
                  >"Harlan Messinger" <h.messinger@co mcast.net> wrote in message
                  >news:c256st$1l 5qte$1@ID-114100.news.uni-berlin.de...[color=green]
                  >>
                  >> Don't prevent the page from submitting. The back end is where you're[/color]
                  >keeping[color=green]
                  >> track of items that have been selected so far. When the user submits the
                  >> final form, if there are too many selected items, send back a page that[/color]
                  >says[color=green]
                  >> so, and let the user remove some choices.
                  >>[/color]
                  >Thank you Harlan for your suggestion!
                  >
                  >I discovered that the only way I can keep a user from selecting more than
                  >one item is by creating and maintaining a database, one where the user would
                  >have to login and the database program would keep tabs as to how many items
                  >the user has selected.[/color]

                  What server-side process are you using? If you use technologies like
                  ASP or JSP, you hold information about a user's session in a Session
                  object. This information persists as long as the session lasts. No
                  databases involved. (There are issues with this--without special
                  add-on technology, you can't use it for sites that are served by
                  multiple servers, and it uses up memory so if you have thousands of
                  sessions going on simultaneously there can be resource issues. But
                  it's useful for a great many purposes.)
                  [color=blue]
                  >In this case it is not worth building it. Sadly this
                  >is the only way to restrict the number of selections a user can make.
                  >
                  >Using cookies, radio buttons or JavaScript won't stop someone who is
                  >determine to select additional items. If the application is using cookies
                  >the user can just delete his/her cookies and start the selection process
                  >again. If the application is using radio buttons that will keep the user
                  >from selecting more than one item but once the form has been submitted, they
                  >can select another item and submit again. The same holds true if you are
                  >using JavaScript to track the number of items being selected.
                  >
                  >Cheers!
                  >[/color]


                  --
                  Harlan Messinger
                  Remove the first dot from my e-mail address.
                  Veuillez ôter le premier point de mon adresse de courriel.

                  Comment

                  • Terabyte

                    #10
                    Re: Restrict selection on form - How?


                    "Harlan Messinger" <hmessinger.rem ovethis@comcast .net> wrote in message >
                    [color=blue]
                    > What server-side process are you using? If you use technologies like
                    > ASP or JSP, you hold information about a user's session in a Session
                    > object. This information persists as long as the session lasts. No
                    > databases involved. (There are issues with this--without special
                    > add-on technology, you can't use it for sites that are served by
                    > multiple servers, and it uses up memory so if you have thousands of
                    > sessions going on simultaneously there can be resource issues. But
                    > it's useful for a great many purposes.)[/color]

                    I understand what you are saying and again I thank you for having this
                    discussion with me. You mention that the information persists as long as the
                    session last.

                    My question is once the session is over, (the user has shutdown their
                    browser and restarted it) will the user create a new session when using the
                    form again and will the user be able to select additional items from the
                    page they selected from earlier?



                    Comment

                    • Harlan Messinger

                      #11
                      Re: Restrict selection on form - How?

                      "Terabyte" <terabyte@roger s.com> wrote:
                      [color=blue]
                      >
                      >"Harlan Messinger" <hmessinger.rem ovethis@comcast .net> wrote in message >
                      >[color=green]
                      >> What server-side process are you using? If you use technologies like
                      >> ASP or JSP, you hold information about a user's session in a Session
                      >> object. This information persists as long as the session lasts. No
                      >> databases involved. (There are issues with this--without special
                      >> add-on technology, you can't use it for sites that are served by
                      >> multiple servers, and it uses up memory so if you have thousands of
                      >> sessions going on simultaneously there can be resource issues. But
                      >> it's useful for a great many purposes.)[/color]
                      >
                      >I understand what you are saying and again I thank you for having this
                      >discussion with me. You mention that the information persists as long as the
                      >session last.
                      >
                      >My question is once the session is over, (the user has shutdown their
                      >browser and restarted it) will the user create a new session when using the
                      >form again and will the user be able to select additional items from the
                      >page they selected from earlier?[/color]

                      When you said you wanted to limit the user to 50 selections, I thought
                      you meant for one request--that is, you didn't want to be sending
                      information on thousands of listings, because of the strain that would
                      place on your server, your network, and the user's computer. I didn't
                      understand that you meant to limit him to 50 selections in his
                      lifetime. If, after the user has seen 50 items, you don't want him to
                      see any more ever again, then yes, you need to persist that
                      information beyond the session. But if you go by a user login, a user
                      who wants to abuse your site can simply register under multiple
                      logins. You could use a cookie, but not all users will let you store a
                      cookie, and a user could then just go to another machine or log in
                      under a different account on his own machine.

                      --
                      Harlan Messinger
                      Remove the first dot from my e-mail address.
                      Veuillez ôter le premier point de mon adresse de courriel.

                      Comment

                      Working...