473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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!
Jul 20 '05 #1
10 2318
"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

"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
"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
I just realized what a form handler is.

Thanks!
Jul 20 '05 #5

"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

"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

"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
"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

"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
Hi all, at present I I've built a website which can be updated by admin and users. My problem, I've combined "log in" and "access levels" to restrict access to certain pages, using the built...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
1
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
4
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have...
9
by: Brett_A | last post by:
I have a form where the first field is a dynamic drop-down that pulls from a db (Access). The fields associated with the query are task_id, task_name and task_rate. The field has the value of...
2
by: vanditnagar | last post by:
Hi, I am facing the difficulty in the selecting a text on the browser . And highlighting the text. I am using the window.getSelection() to get the object and after...
3
by: Venturini | last post by:
I am trying to put together a web page where the customer makes choices of products and is then given a total. I am extremely new to Javascript and have managed to get as far as I have from web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.