View Full Version : JavaScript Selection Box - Tips or Ideas

Eric Marthinsen
07-08-2006, 10:01 PM

I'm working on coding a calendar selection element. It's your basic days in a grid sort of design. The challenge is that someone should be able to use their mouse to select a range of dates, much like how someone would select multiple files in a folder. More specifically, someone should be able to click with their mouse, drag a box, and release the mouse to select all of the dates within the selection box. Has anyone sen something like this? Any tips? Any ideas?


07-09-2006, 08:39 AM
Flash can do that. But I am partial to it :p

However, your request seems simple enough, and seems to want to work similar to holding the ctrl key and clicking various items to select them all...

Knowing that... C+ can do it, which tells me there is a php and/or javascript that can as well.. just not sure how to do those myself.

Eric Marthinsen
07-10-2006, 03:03 AM
Actually, this isn't a control-click sort of thing I'm looking to code. It's more of a drag a box around a bunch of elements and have everything inside that box be selected.

07-10-2006, 04:57 PM
Yes, I understood that part, MS OS does the same thing onthe desktop. If you click and hold and make a box around your desktop icons they all get selected.

It IS very similar to the ctrl click method, except the code is put on mouseover and mouse down/up event handling.

Like I said, Flash can do it with about 20 lines of script total, and Flash is very simialr to php and javascript (and uses both)

Using that logic I am sure there is a PHP and/or javascript way of doing it, I just don't know how.