473,479 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

making a selection

hi all,

I have this simple problem:
A user has to select his 3 favorite numbers from a list of 100 numbers. I
want to show these numbers with some sort of checkbox. How can I create a
groep of checkboxes that are somehow linked in a way the user can only
select maximum 3 numbers?

I hope someone can help me out

thanks
Stijn
Jul 23 '05 #1
3 1085
"Stijn Goris" <me*****@hotmail.com> wrote:
How can I create a
groep of checkboxes that are somehow linked in a way the user can only
select maximum 3 numbers?


I have a reusable library called "CheckboxGroup" which will do exactly this.
You can assign all the checkboxes to a group, and then limit the number of
boxes that can be checked. If you try to check more than the limit, it will
alert a message and not allow you to do so.
http://www.mattkruse.com/javascript/checkboxgroup/

Be aware, though, that you should also validate this on the server-side,
too, because someone may disable javascript in their browser and then be
able to pick as many as they want.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #2

"Matt Kruse" <ne********@mattkruse.com> wrote in message
news:c6*********@news4.newsguy.com...
"Stijn Goris" <me*****@hotmail.com> wrote:
How can I create a
groep of checkboxes that are somehow linked in a way the user can only
select maximum 3 numbers?
I have a reusable library called "CheckboxGroup" which will do exactly

this. You can assign all the checkboxes to a group, and then limit the number of
boxes that can be checked. If you try to check more than the limit, it will alert a message and not allow you to do so.
http://www.mattkruse.com/javascript/checkboxgroup/

Be aware, though, that you should also validate this on the server-side,
too, because someone may disable javascript in their browser and then be
able to pick as many as they want.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/


This is indeed the stuff I need. Although it would be better I think if a
box is unchecked when the user checks another (fourth) box instead of giving
him a warning
Jul 23 '05 #3
"Stijn Goris" <me*****@hotmail.com> wrote:
This is indeed the stuff I need. Although it would be better I think if a
box is unchecked when the user checks another (fourth) box instead of giving him a warning


How would you know which box to uncheck?

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3283
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)...
4
1860
by: Next Generation Technologies Inc. | last post by:
Now what I have is a function that only works in WinIE4+ because it's uses Microsoft proprietary properties and methods: function gmshortcutkeys() { if ((parseInt(navigator.appVersion) >= 4)...
1
2097
by: Wouter | last post by:
Hi, I would like to make a dropdown menu. When a user select something i want to use his selection in PHP for a next dropdown menu. When the user has selected something in the second dropdown...
6
27328
by: Ronny sigo | last post by:
Hello all, I have made a form with a lot of entryfields and one button which, when clicked on, transforms all of the entryfields values into a MS Word document. All the formatting is done...
5
12830
by: STeve | last post by:
Hey guys, I currently have a 100 page word document filled with various "articles". These articles are delimited by the Style of the text (IE. Heading 1 for the various titles) These articles...
2
3432
by: Jason Sobell | last post by:
Hi, I'm trying to figure out a sensible way of making a combobox (configured as a dropdown list) behave in a read-only fashion. Setting Enabled=False will grey the text and the background, but I...
2
3042
by: 23s | last post by:
I have a dropdown bound to a dataview. The binding assigns the dropdown with a SelectedIndex of 0. There is a msgbox in the SelectedIndexChanged event that displays the SelectedIndex property....
5
1401
by: ddhung | last post by:
how to insert multible values by making one selection from combo box in forms. any way to code insert SQL in froms??
7
1279
by: coolindienc | last post by:
I am not sure what am I supposed to assign for my while loop to work at the bottom. Please help me to understand what I am doing wrong. Below is my code and I have highlighted my main module. I...
2
5914
by: colin | last post by:
Hi, I need to tell how many rows are visible on the screen, in my DataGridView control so that I can ensure my newly selected row is visible without doing any unecessry scrolling, I thought...
0
7033
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
6903
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7027
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
7071
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...
1
6726
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5318
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.