Solved

How do I set up a client-side combo box selection and response feature

Posted on 2013-01-26
3
363 Views
Last Modified: 2013-11-19
Dear Experts,

I would like to set up a feature on my webpage that identifies the person/people in our organization that can assist a user with their concern.

The code below is what I currently have set up. When a user clicks a 'challenge' in the dropdown the page will automatically go to the person that can assist. The problem is that there might be more than one person that can assist.

What I would like to do (of course if you see a better solution let me know) is set up a memo box object that would 'fill in' all the people or person who could assist with this concern. The syntax would have to be client site as I do not have server side scripting capabilities at the moment. Perhpas XML? Bottom line is if the user picks the first option "logging into the network" the memo box or div would populate with names and contact information for those individuals who could assist.

Any ideas you could suggest would be most helfpul. Thanks!

<SELECT onchange="window.location.href=this.options[this.selectedIndex].value">
<OPTION VALUE="#iss">Select an response</OPTION>
<OPTION VALUE="#smith">logging into the network</OPTION>
<OPTION VALUE="#johnson">replacing computer ink</OPTION>
<OPTION VALUE="#ladden"></OPTION>
</SELECT>


<div id="smith"></div>
<div id="iss_info">
<img src="images/female-icon.png" />
<p class="boxTxt"><span class="name">Terri Smith</span> <span class="title"> - IT Specialist</span><br />
  How can I support you....<br />
    &raquo; &nbsp;Here is where I would write Ms. Smith responsibilities in the organization and contact information.
 </p>

Open in new window

0
Comment
Question by:shogun5
  • 2
3 Comments
 

Author Comment

by:shogun5
ID: 38823144
I suppose I could use something like this but I would need to populate a text box or memo box with the string. How would I do this?

function PrintValues(){

  var myString = document.mainform.file.value
  var myStringLength = myString.length
  var Comma = myString.lastIndexOf(',')
  var SufNumChars = Comma + 1

  document.who.result.value=('');

  for(i=0; i<Comma; i++) 
  document.who.result.value+=(myString.charAt(i));

  document.who.result.value+=(' ');

  for(i=SufNumChars; i<myStringLength; i++) 
  document.who.result.value+=(myString.charAt(i));

}
</script>




<form name="mainform">
<select name="file" size="1" onchange="PrintValues();"  target="_parent._top" onmouseclick="this.focus()">
  <option value="Joe,Yin">First Option</option>
  <option value="Hi,Me">Second Option</option>
</select>
</form>




<form name="who">
<textarea cols="40" rows="5" name="result">

</textarea>
</form>

Open in new window


Is there is better way to do this?
0
 
LVL 11

Accepted Solution

by:
mcnute earned 500 total points
ID: 38824030
The html file is retreiving values from within the xml file according to the selected value. Enjoy!
index.html
area-support.xml
0
 

Author Closing Comment

by:shogun5
ID: 38825090
Yep! Worked like a charm! Thanks!

Cheers!

Mike
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question