Show off your HTML/Javascript cleverness
Gabriel Vieira
gabriel.vieira at gmail.com
Sun Aug 31 18:21:39 BST 2014
Check this solution.. I used jQuery for input selection.
http://jsfiddle.net/mpw1j24L/
https://gist.github.com/gabrielmad/800e127ec25e235c73dd
It can be used with radio or checkbox inputs.
Regards,
On Sun, Aug 31, 2014 at 8:14 AM, Dave Cross <dave at dave.org.uk> wrote:
>
> I need some HTML/Javascript help.
>
> See http://dave.org.uk/grid.html.
>
> On this page you have a list of courses (Course 1 to Course 6) and three
> time periods (T1 to T3). The idea is that each person will select one
> course for each of the three time periods.
>
> I have it set up so that each time period has a set of radio buttons
> associated with it (one for each course). This ensures that each person can
> select only one course per time period. But it doesn't stop them from
> selecting the same course for all three time periods - which I don't want
> to allow.
>
> Then there's course 6. Course 6 runs across all time periods. If you
> select course 6 then you can't select any more courses.
>
> I guess I need to write some Javascript that enforces these extra
> rules[1]. But I thought that the clever people in london.pm might have
> some clever ideas. So I'm asking you first.
>
> How would you implement this?
>
> Dave...
>
> [1] And, yes, I know I'd need to implement the same checks server-side as
> well.
>
> --
> Dave Cross :: dave at dave.org.uk
> http://dave.org.uk/
> @davorg
>
--
Gabriel Vieira
More information about the london.pm
mailing list