Hello,
I am hoping someone can help me with this...
LANGUAGES: HTML, PHP, LDAP, JavaScript
SYNOPSIS: Create a drop-down list of users from Active Directory, when the user is selected various attributes for that user be displayed in greyed out <input type="text" disabled> fields (the values of these fields will be posted on submit)
A bit of setup:-
[someform.php]
<?php
$attrs = array("cn", "sn", "title", "telephoneNumber","postalCode","postalAddress");
$usersarray=ldap_search($ldapconn, $dn, "(objectClass=user)", $attrs);
ldap_sort($ldapconn, $usersarray, "cn");
$userentries = ldap_get_entries($ldapconn, $usersarray);
?>
<table>
<tr>
<td><label>Your name <font color="red">*</font></label></td>
<td><select name="sender">
<?
for ($i=0; $i<$userentries["count"]; $i++) { ?>
<option><? echo $userentries[$i]["cn"][0]; ?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td><label>Your Name</label></td>
<td colspan="3"><input type="text" name="Sender" value="// 'cn' of currently selected user from $userentries[] above //" disabled></td>
</tr>
<tr>
<td><label>Next Field</label></td>
<td colspan="3"><input type="text" name="Something" value="// 'foo' of currently selected user from $userentries[] above //" disabled></td>
</tr>
<tr>
etc. etc.
</table>
THOUGHTS: A JavaScript function (not my strength) and the onChange method in the <select> tag.
I would greatly appreciate anyones help with this... Let me know if you need more information.
Regards,
Trent.