Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 06:50 PM
Terabyte
Guest
 
Posts: n/a
Default 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!


  #2  
Old July 20th, 2005, 06:51 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?

"Terabyte" <terabyte@rogers.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

  #3  
Old July 20th, 2005, 06:53 PM
Terabyte
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?


"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
news:Xns949EDFBE94A91jkorpelacstutfi@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


  #4  
Old July 20th, 2005, 06:53 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?

"Terabyte" <terabyte@rogers.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

  #5  
Old July 20th, 2005, 06:53 PM
Terabyte
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?

I just realized what a form handler is.

Thanks!


  #6  
Old July 20th, 2005, 06:53 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?


"Terabyte" <terabyte@rogers.com> wrote in message
news:B160c.49074$Qg7.38939@news04.bloor.is.net.cab le.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.

  #7  
Old July 20th, 2005, 06:54 PM
Terabyte
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?


"Harlan Messinger" <h.messinger@comcast.net> wrote in message
news:c256st$1l5qte$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!


  #8  
Old July 20th, 2005, 06:54 PM
Terabyte
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?


"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
news:Xns94A1BFDBCD7A6jkorpelacstutfi@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. ;~)


  #9  
Old July 20th, 2005, 06:54 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?

"Terabyte" <terabyte@rogers.com> wrote:
[color=blue]
>
>"Harlan Messinger" <h.messinger@comcast.net> wrote in message
>news:c256st$1l5qte$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.
  #10  
Old July 20th, 2005, 06:55 PM
Terabyte
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?


"Harlan Messinger" <hmessinger.removethis@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?



  #11  
Old July 20th, 2005, 06:55 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: Restrict selection on form - How?

"Terabyte" <terabyte@rogers.com> wrote:
[color=blue]
>
>"Harlan Messinger" <hmessinger.removethis@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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles