In my code, I created a table from the output of an ldap search with the output (in the form of an array) being in the first column. What I would like to do is depending on the link clicked, have some text appear in the second column. I have figured out how to get "Hello World" to appear but it appears regardless of the link I choose. Is there a way to make the text change based on the link the user clicks? For example if the user clicks link 1 the right column would display "Hello" but if the user selects link 2 the right column displays "Goodbye". The idea I have is
If (link that's clicked text eq $textToMatch) {
print some text
}
Here is the code I have:
if (($corpId ne "")&&($CorpIdResults eq "")) {
print "This user does not belong to any groups.";
} elsif ($CorpIdResults ne "") {
@splitarray = split(' ',$CorpIdResults);
print "Corp Id: " . $corpId;
print "<BR>";
print "<BR>";
print "This user is a member of the following groups:";
print "<BR>";
print "<TABLE border=22>";
foreach $tmp (@splitarray) {
print "<TR>";
$links = "<a href = 'javascript:testFunction()' id='groups' >$tmp \n</a><BR>";
print "<TD>$links</TD>";
}
print "<TD id='demo'></TD>";
print "</TR>";
print "</TABLE>";
}
Hopefully I made that clear enough. If not, please let me know.