Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post

    <select multiple> maximum?

    Hello,

    can someone tell me how I can limit the number of options a user can select to 4, is there a maximum attribute?

    <select name="VoteCoucil" multiple="multiple" size="6">
    <option>...</option>
    </select>

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    You'll have to use javascipt for that.... for a script that will do it (I assume; I didn't test it), try here:

    http://forum.weborum.com/lofiversion...php/t2454.html

    I know, I know, I just sent you to a different forum *gasp*, but at least the code referenced was written by a (former?) CF'er....

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    Works great, thanks for the tip.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •