Solved

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

Posted on 2013-01-26
3
332 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
Comment Utility
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
Comment Utility
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
Comment Utility
Yep! Worked like a charm! Thanks!

Cheers!

Mike
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now