Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to made this in coldfusion

New Here ,
Feb 19, 2010 Feb 19, 2010

Hi

users must have the ability to select multiple options from dropdown  when generating reports .  In addition, the user must have the ability to see which options  were selected prior to generating the report.

Thanks,

TOPICS
Getting started
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2010 Feb 19, 2010

Personally I prefer checkboxes but,

<select multiple="multiple">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 23, 2010 Feb 23, 2010

In addition to the multiple setting you may want to use size="10", then maybe a note to the side of the field letting the user know they can select multiples by holding down the "Ctrl" key.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2010 Feb 24, 2010

i got that by using multiple options but i need to show user which options user selected just below that drop down

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2010 Feb 24, 2010

Try what I have below.  Pretty sure its what's you are try to do.  Hope this helps.  If it answers your question please mark as so, I'm new to these forums and I'd like to generate some points.

<script>
function myFunc(obj)
{
  document.getElementById('mySpan').innerHTML=''; //blank it out
  //loop through the options
  for (i=0; i <= obj.options.length - 1; i++)
  {
   if (obj.options.selected)
   {
    if (document.getElementById('mySpan').innerHTML == '') //first one, don't lead with comma
     document.getElementById('mySpan').innerHTML=obj.options.value;
    else
     document.getElementById('mySpan').innerHTML=document.getElementById('mySpan').innerHTML+', '+obj.options.value;
   }
  }
}
</script>

<select name="test" id="test" multiple="true" size="10" onclick="myFunc(this)">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
<option value="7">Seven</option>
<option value="8">Eight</option>
<option value="9">Nine</option>
<option value="10">Ten</option>
</select>
<br>
You have selected: <span id="mySpan"></span>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2010 Feb 24, 2010

hi thanks for ur help but when i copied this in my local system it is not working and when i select options i am not able to see at bottom

please check this once thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2010 Feb 24, 2010

sorry thanks for ur help its working now i will try now and see

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2010 Mar 03, 2010

hi your answer helps me a lot but in my drop down box i had check boxes to select these options for this how to implement this javascript , i am not able to get this logic here is code below, where the select box is written in custom tags that will generate dropdown

<cf_dsp_select query="#qry#"  onclick="myFunc(this)" multiple="true" size="5" label_class="required" validation="checkRequired(this)"
        label="Div" name="my_no" value="my_no" text="$my_no$ " >           
    </cf_dsp_select>

for the above custom tag i will get dropdown options with check box , for this i am not getting this logic to implement javascript , please help me

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2010 Mar 03, 2010
LATEST

hi here is what the custom tag is geenrating

<form>

    <input type="checkbox" value="005" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">one

    <input type="checkbox" value="006" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Two

    <input type="checkbox" value="007" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Three 

  <input type="checkbox" value="008" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Four

    <input type="checkbox" value="009" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Five

    <input type="checkbox" value="010" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Six

    <input type="checkbox" value="011" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Seven

    <input type="checkbox" value="012" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Eight

    <input type="checkbox" value="013" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Nine

    <input type="checkbox" value="014" style="margin: 0px 8px 0px 2px;" name="div_no" id="div_no">Ten

</form>

from this how we do that javascript to work .

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources