I have a form that is supposed to preload hidden form fields with user info via LDAP. Occasionally the LDAP server is down or there are other problems, and some of these fields are not populated properly.
What I am wondering is whether there is a way to dynamically change the field type from hidden to text when the LDAP query fails to return a valid result.
I’ve tried something like this without success:
Prepopulate the field with ASP and LDAP:
[CODE]<input type=”hidden” name=”name” size=”20″ value=”<%=vName %>”>
Then, if the field is empty, the client side JS would change the field type to “text” so that an empty field is displayed for the user to fill out:
[CODE]<script type=”text/javascript”>
<!–
if (form.name.value == “”)
{
form.name.type = “text”
}
–>
</script>
When I run this code, I get the following error in IE:
[QUOTE]
Could not get the type property. This command is not supported.
Is there any way to make this work?
Thanks for any insight or assistance!