Hi Monks,
I have 2 drop downs in a page one with Student name and second with label exams list which he has appeared. I am obtaining the values for these 2 fields from database table by below query
. @exams ="select EXAMS_APPEARED from student_details where student_name="xyz" order by 1"
I am using the values of these @exams as options in second drop down. When i select student name from first drop down , the second drop down should display only the exams which he has appeared . For this i have written a javascript function as below
#java script function function displayExams() { var student = document.getElementById("STUDENT_NAME").value; var exams=document.getElementById("EXAMS_APPEARED").value;
and calling this function with onclick event like as below
select style='$style_input' name='EXAMS_APPEARED' id='EXAMS_APPEARED' +onClick=\"displayExams();\" > <option value=''>--Select--</option> "; my $ExamsCount=@ExamsAppeared; for (my $j=0;$j<$ExamsCount;$j++) { $DisplayString=$DisplayString."<option value='$ExamsAppeared[$j]'>$Exa +msAppeared[$j]</option>\n"; } @ExamsAppeared = getdbresult(); sub getdbresult { # for getting the db data stmts... }
After opening the application webpage, when i select the student name from drop down, the second drop down on click should only display the exams which he has appeared, but it displaying exams_ appeared for all the student. Could you please rectify my mistake and help me to fix this issue.

In reply to Unable to populate the aasociated values as options in a dropdown by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.