Oct 4, 2000 #1 PerryG Programmer Aug 15, 2000 75 US Is there anyway to limit the # of selections from a select box to say 3 or 5 maximum selections? Thanks. PerryG [sig][/sig]
Is there anyway to limit the # of selections from a select box to say 3 or 5 maximum selections? Thanks. PerryG [sig][/sig]
Oct 5, 2000 #2 perichazhi Programmer Jul 17, 2000 25 IN It can be done through coldfusion as well as javascript Javascript : to be written in the onclick event of the select box cbomultiselect. var myselections = form.cbomultiselect.value; if (myselections.indexof("," > 2) alert("Only 3 selections allowed" Coldfusion: Submit the form. In the target form try the following code. <cfset selections=#form.cbomultiselect#> <cfif FIND(#selections#,",",1) GT 2> Only 3 selections allowed </cfif> [sig][/sig] Upvote 0 Downvote
It can be done through coldfusion as well as javascript Javascript : to be written in the onclick event of the select box cbomultiselect. var myselections = form.cbomultiselect.value; if (myselections.indexof("," > 2) alert("Only 3 selections allowed" Coldfusion: Submit the form. In the target form try the following code. <cfset selections=#form.cbomultiselect#> <cfif FIND(#selections#,",",1) GT 2> Only 3 selections allowed </cfif> [sig][/sig]