Solved

Adobe  form dropdown menu with Java Script

Posted on 2013-11-05
5
452 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
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…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

729 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