Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

dropdown text value display

Avatar

Former Community Member

Hi every body,

plz help me i just got stuck in the mid of my form, i am very much new to java plz help me.

i have designed a form with four dropdown lists drop1, drop2, drop3 and drop4 i need a value for ever text in the drop down e.g if there is a text Economics in the drop down i need its numeric value for that i have four numeri fields i.e drop1fee,drop2fee,drop3fee and drop4fee . and put the script is like this :

switch (this.selectedIndex)

{

case 0:

drop2Fee.rawValue = 123;

break;

case 1:

  drop2Fee.rawValue = 234;

   break;

case 2:

drop2Fee.rawValue = 432;

   break;

case 3:

  drop2Fee.rawValue = 550;

   break;

   case 4:

    drop2Fee.rawValue = 650;

   break;

   case 5:

drop2Fee.rawValue = 455;

   break;

   case 6:

  drop2Fee.rawValue = 190;

   break;

   case 7:

   drop2Fee.rawValue = 213;

   break;

   case 8:

    drop2Fee.rawValue = 456;

   break;

   case 9:

drop2Fee.rawValue = 444;

   break;

   case 10:

    drop2Fee.rawValue = 678;

   break;

   case 11:

   drop2Fee.rawValue = 990

   break;

   default:

   break;

case 0: gives me the first or you may say zero postion value of selected index of the drop 1 i.e 123 in the numeric filed1 which is by the name of drop1fee

then case second gives me the second value in the drop2fee numeric field i.e 234.

but i am facing the problem i.e every dropdown gets populated on the mouse click of different radiobutton courses , when i click radiobutton BA evry dropdown gets populated accordingly i mean to say the subjects pertainig to Arts gets populated. Now is the case , when i click on another course like B.Com or B.Sc the subjects pertaining to B.Com or B.Sc gets popluated in every dropdown. the slected index value of B.com /B.Sc subjects are different other than arts so it gives me the value of Arts index value of dropdown .i.e it gives me evry time 123 value aty selected index of drop down what ever may be the case whether it is BA , B.Sc or B.Com or BBA inspite of having different values ..

plz help me to sort out this problem.

thanking Every body in advance

0 Replies