From: Chris R. <chr...@me...> - 2002-01-28 14:52:54
|
"Cox, Todd (NCI)" <tc...@ma...> wrote: > Thank you Chris for your reply. > > The following is a small section of where my problem actually is: > > if($current_page == 0) > { > print "Please enter a name to edit:<br>(Use an * to perform a > wildcard search)<br>"; > > }elsif($current_page == 1){ > > $input_name = param('Login Name'); > $r = LDAPsearch("cn=$input_name","o=matrix"); > > if(!param('Login Name')){ > > print "Login Name field was left blank. Please go > back and enter a login name to search on.<br>"; > print submit(-name=>'go',-value=>'Start Page') if > $current_page > 0; > $flag = 1; > > }elsif($r->entries) > { > print "Current page: $page_name<br>"; > print "<br>User(s) matching search request:<br>"; > > foreach my $entry ($r->entries){ > > > $user = $entry->dn; > push(@userList,$user); > # I have tried to come up with a way to > store the information in a hash but haven't had much luck > > } > > print popup_menu(-name=> 'Login Name',-size=>1, > -VALUES => [ @userList ]); > $flag=1; > > print "<p>Please select a user to continue.<br>", > > hidden(-name=>'page',-value=>$current_page,-override=>1), > submit(-name=>'go',-value=>'Previous Page'), > submit(-name=>'go',-value=>'Get Attributes'); > > }else{ > > print p("Attribute Information for: "), param('Login > Name'); > # At this point I need to have the selected user and > attributes. > } > > } > > The code above is part of a subroutine called draw_form(). After the above > condition it will display the fields I want the user to be able to > modify. I have a @attribute array so that the search only returns the > values I want. > > Any thoughts are greatly appreciated. I think I see. I can't remember the CGI module too well, but IIRC there is a way for popup menus to display one string, but return another value back. You could arrange it so that the displayed values are the DNs, but the values you get back are the indexes to the entry. Then you can do $r->entry(n) to get back the specific Entry object corresponding to the index you get back from popup_menu. Cheers, Chris |