By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,979 Members | 951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,979 IT Pros & Developers. It's quick & easy.

Restrict selection on form - How?

P: n/a
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!
Jul 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
"Terabyte" <te******@rogers.com> wrote:
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?


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

Jul 20 '05 #2

P: n/a

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
Not in HTML.

The form handler can impose any restrictions you like.

Thank you for replying!
Are you talking about using forms? If not what are form handlers?

Elton
Jul 20 '05 #3

P: n/a
"Terabyte" <te******@rogers.com> wrote:
Are you talking about using forms?
Yes. Aren't you?
If not what are form handlers?


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

Jul 20 '05 #4

P: n/a
I just realized what a form handler is.

Thanks!
Jul 20 '05 #5

P: n/a

"Terabyte" <te******@rogers.com> wrote in message
news:B1*******************@news04.bloor.is.net.cab le.rogers.com...
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?


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.

Jul 20 '05 #6

P: n/a

"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:c2*************@ID-114100.news.uni-berlin.de...

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.

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!
Jul 20 '05 #7

P: n/a

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..

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


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. ;~)
Jul 20 '05 #8

P: n/a
"Terabyte" <te******@rogers.com> wrote:

"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:c2*************@ID-114100.news.uni-berlin.de...

Don't prevent the page from submitting. The back end is where you'rekeeping
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.

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.


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.)
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!

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #9

P: n/a

"Harlan Messinger" <hm*******************@comcast.net> wrote in message >
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.)


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?

Jul 20 '05 #10

P: n/a
"Terabyte" <te******@rogers.com> wrote:

"Harlan Messinger" <hm*******************@comcast.net> wrote in message >
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.)


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?


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.
Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.