Jump to content

  • 0

Trying to add extra OU value based on checkbox for Windows 8 in HTA


I am trying to add step to my HTA file, an extra OU value if Windows 8 checkbox is checked (OU=Windows8,) in front of the OU path that gets outputted (OUName). Currently my drop down contains the following:

td colspan=1 class="taskTableLeftCell">OU</td>
				<td class="taskTableSpanSecondAndThirdCell">
				<select name="OUName" id="OUName">
				<option value="LDAP://OU=Administrative,OU=Workstations,DC=imo-online,DC=com" >Administrative</option>
				<option value="LDAP://OU=Development,OU=Workstations,DC=imo-online,DC=com" >Development</option>
				<option value="LDAP://OU=External,OU=Workstations,DC=imo-online,DC=com" >External</option>
				<option value="LDAP://OU=IT,OU=Workstations,DC=imo-online,DC=com">IT</option>
				<option value="LDAP://OU=Restricted,OU=Workstations,DC=imo-online,DC=com">Restricted</option>
				<option value="LDAP://OU=Sales,OU=Workstations,DC=imo-online,DC=com" >Sales</option>
				<option value="LDAP://OU=Service_Computers,OU=Workstations,DC=imo-online,DC=com" >Service Computers</option>

My checkbox says the following

<input type>"checkbox" id="mycheck" value"OU=Win8,"/>

Then I have my Java saying:

function Win8()
var x=document.getElementById("myCheck").value;

The other java code is below which adds these 2 ou values together:

var OUDrop = document.getelementById("OUName") + document.getElementById("Win8");

When I try to run this and proceed in my script I get an answer- Unable to get property 'undefined' of undefined or null reference. Not sure what I am doing wrong.

Share this post

Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

doesn't the error include any number, usually that points to the line it's failing on (line number)

use NotePad ++ to edit your code, mistakes will show up easier

Share this post

Link to post
Share on other sites

  • 0

this can't work

var OUDrop = document.getelementById("OUName") + document.getElementById("Win8");

if (document.getElementById("mycheck").checked){

var win = "OU=Win8,";


else {

var win = "";


var OU = document.getelementById("OUName").options[document.getelementById("OUName").selectedIndex].value;

var OUName = "LDAP://" + win + OU;



In this case you need to get rid of the LDAP:// prefix in your select.


The question is why do you need a special OU for WIndows 8 Clients. It doesn't make much sense tou group your clients by OS in the AD.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...