Multiple Selects

Results 1 to 2 of 2

Thread: Multiple Selects

  1. #1
    Little Imp Guest

    Default Multiple Selects

    I have created a list select which can offer the user multiple selections if the control key is held down and is populated from a database:-<BR><BR>&#060;select name="keywords" size=7 multiple&#062;<BR> &#060;% <BR> Do while NOT oRsKeyword.EOF %&#062;<BR> &#060;Option value = "&#060;%= oRsKeyword("KeywordText") %&#062;"&#062; &#060;%= oRsKeyword("KeywordText") %&#062;&#060;/Option&#062;<BR> &#060;% oRsKeyword.MoveNext<BR> Loop<BR> %&#062;<BR><BR> &#060;/select&#062;&#060;/td&#062;<BR><BR>When the user is happy with their selections they then click on a confirm button which then calls the following function: -<BR><BR>function Onkeywords()<BR> {<BR> var keyword_string = "";<BR> <BR> var keyword_selected = window.document.submitform.keywords;<BR> <BR> for(loop=0; loop &#060; keyword_selected.options.length; loop++)<BR> {<BR> if(keyword_selected.options[loop].selected == true)<BR> { <BR> if(keyword_string == 0)<BR> {<BR> keyword_string = keyword_selected.options[loop].text;<BR> }<BR> else<BR> {<BR> keyword_string += " + " + keyword_selected.options[loop].text; <BR> }<BR> }<BR> }<BR> window.document.submitform.selectedkeywords.value = keyword_string;<BR> }<BR><BR>And updates the screen confirming the users choice with a string.<BR><BR>This outcome is what I am trying to achieve but there are two areas which I wish to eliminate:<BR><BR>1) I don&#039;t want the user to have to hold down control. I would rather it be toggle on a selection and then click again to toggle off.<BR>2) Not to have a confirm button but to write out the string when a item is toggled on and to amend the string if its toggled off.<BR><BR>Are these two suggestions possible or would it be a case of having to call another script every time an item is clicked in order to update the string.<BR><BR>Any advice would be welcome.

  2. #2
    Heaven's Martini Guest

    Default RE: Multiple Selects

    Hmm<BR><BR>1. want the toggle? use a checkbox.<BR><BR>2. well, you could use a layer i would think, or possibly an iframe. on the function call OR<BR>Using a textbox is far and away the easiest to write out the string however.

Posting Permissions

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