Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adobe  form dropdown menu with Java Script

Posted on 2013-11-05
5
Medium Priority
?
464 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
3 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Suggested Courses

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