Solved

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

Posted on 2013-01-26
3
349 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with Syntax 9 36
ROBOFTP UNZIP 1 38
Remove third quote mark from widget 6 23
push logos in footer up higher 5 20
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

785 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