Solved

Adobe  form dropdown menu with Java Script

Posted on 2013-11-05
5
455 Views
Last Modified: 2013-11-06
Hi I am new to Java
Need help with a dropdown menu, using JavaScript with this menu. The text that the user sees I only need part of the text to print, I need to hide the (D) and (E) from printing. Below is the script I am using
Thank you
// Place all prepopulation data into a single data structure
var DeptData = { "ALCOHOL & DRUG COUNSELING (D)":{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "30", 
                              TUITION: "15792",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "ALCOHOL & DRUG COUNSELING (E)":{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "37", 
                              TUITION: "15792",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },  
                 "DENTAL ASSISTANT (D)":{ ClockHours: "960",
                              CreditHours: "25.60",
                              Weeks: "30", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "DENTAL ASSISTANT (E)":{ ClockHours: "960",
                              CreditHours: "25.60",
                              Weeks: "54", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },  
                 "DIAGNOSTIC MEDICAL SONOGRAPHER (D)" :{ ClockHours: "2,388",
                              CreditHours: "63.68",
                              Weeks: "92", 
                              TUITION: "36782",
                              REGISTRATIONFEE: "100",
                              STRF: "18" },
                 "DIAGNOSTIC MEDICAL SONOGRAPHER (E)" :{ ClockHours: "2,388",
                              CreditHours: "63.68",
                              Weeks: "128", 
                              TUITION: "36782",
                              REGISTRATIONFEE: "100",
                              STRF: "18" },
                 "FITNESS TRAINER (D)":{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "30", 
                              TUITION: "15792",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "FITNESS TRAINER (E)":{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "43", 
                              TUITION: "15792",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "HOLISTIC MASSAGE THERAPY (D)" :{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "30", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "MEDICAL ASSISTANT (D)" :{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "30", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "MEDICAL ASSISTANT (E)" :{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "38", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "MEDICAL BILLER (D)" :{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "30", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "MEDICAL BILLER (E)" :{ ClockHours: "900",
                              CreditHours: "24.00",
                              Weeks: "38", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "NURSE ASSISTANT (D)" :{ ClockHours: "182",
                              CreditHours: "4.85",
                              Weeks: "7", 
                              TUITION: "2404",
                              REGISTRATIONFEE: "100",
                              STRF: "1" },
                 "PHARMACY TECHNICIAN (D)" :{ ClockHours: "760",
                              CreditHours: "20.27",
                              Weeks: "32", 
                              TUITION: "16592",
                              REGISTRATIONFEE: "100",
                              STRF: "8" },
                 "SURGICAL TECHNOLOGY (D)" :{ ClockHours: "1620",
                              CreditHours: "43.20",
                              Weeks: "50", 
                              TUITION: "30785",
                              REGISTRATIONFEE: "100",
                              STRF: "15" }, 
                 "SURGICAL TECHNOLOGY (E)" :{ ClockHours: "1620",
                              CreditHours: "43.20",
                              Weeks: "62", 
                              TUITION: "30785",
                              REGISTRATIONFEE: "100",
                              STRF: "15" }}; 
function SetFieldValues(cDeptName)
{
  this.getField("ClockHours").value = DeptData[cDeptName].ClockHours;
  this.getField("CreditHours").value = DeptData[cDeptName].CreditHours;
  this.getField("Weeks").value = DeptData[cDeptName].Weeks;
  this.getField("TUITION").value = DeptData[cDeptName].TUITION;
  this.getField("REGISTRATIONFEE").value = DeptData[cDeptName].REGISTRATIONFEE;
  this.getField("STRF").value = DeptData[cDeptName].STRF;
}

if( event.willCommit )
{
   if(event.value == " ")
     this.resetForm(["ClockHours","CreditHours","Weeks","TUITION","REGISTRATIONFEE","STRF"]);
   else
     SetFieldValues(event.value);
}

Open in new window

0
Comment
Question by:genewc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 39625900
I don't think we have all the information to help you yet. Can you please explain in a bit more detail what you want to accomplish. In which context are you using this script?

You can attach a PDF file to this question, so if you have a file that shows what you want to accomplish, it would be beneficial to have such a sample.
0
 

Author Comment

by:genewc
ID: 39626704
I've requested that this question be deleted for the following reason:

will post with more info
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 39627024
There is no reason to delete this question. Just post more information in a comment. And, request that the question be open and unanswered again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Can Be Caused By Disabled Services I have encountered a problem viewing PDF files using Adobe Acrobat Reader.  For the longest time, PDFs might launch or might not.  Sometimes they took about 15 minutes to appear after launching them. After som…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…

617 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