Solved

Adobe  form dropdown menu with Java Script

Posted on 2013-11-05
5
445 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

920 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

14 Experts available now in Live!

Get 1:1 Help Now