Rename your select "filelistselect",
create a hidden field named "filelist"
and call this JS function in the onsubmit of the form:
function makeList(thisform){
var opts = thisform.filelistselect.options,
val="",
i=0;
for(;i<opts.length;i++){
if(opts[i].selected){
if(i==0 || !opts[i-1].selected){
val += ((val.length>0)?",":"") +
opts[i].value;
}
else if(i==opts.length-1 ||
!opts[i+1].selected){
val += "-" + opts[i].value;
}
}
}
thisform.filelist.value = val;
thisform.filelistselect.disabled = true;
}
<form ... >
Pascal
>
>
> I need to pass it like 1-16,23-25,30,33,40-42,46-48 to the server.
>
> >> <select name="filelist" size="15" multiple class="dirlinks">
> >>
> >> <cfloop INDEX="i" FROM="1" TO="#ArrayLen(arPages)#">
> >>
> >> <cfset sVal = Trim(ListFirst(arPages[i], ">"))>
> >>
> >> <cfset sDisp = Trim(ListLast(arPages[i], ">"))>
> >>
> >> <cfset sValNoComma = NumberFormat(sVal, "9999999999")>
> >>
> >> <cfset sVal = NumberFormat(sVal)>
> >>
> >> <option value="#sValNoComma#">Seq:
> >> #sValNoComma# Folio: #sDisp##spacer1#</option>
> >>
> >> </cfloop>
> >>
> >> </select>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- re: Arrange sequential selections into ranges how to??? Nathan R. Jessop
- RE: Arrange sequential selections into ranges how to... Pascal Peters
- RE: Arrange sequential selections into ranges ho... Nathan R. Jessop
- RE: Arrange sequential selections into ranges how to... Pascal Peters
- RE: Arrange sequential selections into ranges ho... Nathan R. Jessop
- RE: Arrange sequential selections into ranges ho... Nathan R. Jessop
- RE: **UPDATE** Arrange sequential selections int... Nathan R. Jessop
- RE: **UPDATE** Arrange sequential selections... Steve Nelson
- RE: **UPDATE** Arrange sequential select... Steve Nelson
- RE: **UPDATE** Arrange sequential s... Barney Boisvert
- RE: **UPDATE** Arrange sequenti... Steve Nelson
- RE: **UPDATE** Arrange sequ... Barney Boisvert
- RE: **UPDATE** Arrange sequential selections... Barney Boisvert
- RE: Arrange sequential selections into ranges how to... Pascal Peters