Jump to content

kevschu

Members
  • Posts

    2
  • Joined

  • Last visited

About kevschu

  • Birthday 01/20/1984

Previous Fields

  • Languages
    vbscript

Profile Information

  • Location
    Portland

kevschu's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. ha! thank you justsomeguy! changed the case of "value" from uppercase to lowercase and it works.
  2. So, I am a newbie at javascript, the only reason I went this route is because my vbscript was giving a "type mismatch" error and could not figure that out so I am trying javascript in its place. What I am trying to do is have a drop down with Domains listed in it, and then depending on the selection it chooses the OU as well from a switch statement. I can see that the Function I created is getting the joindomain.value by using the alert, but then the switch is not working for some reason, I think I am missing something pretty basic? I have searched on how to do javascript switch statements and from what I am picking up I have done this correctly as far as I can tell. The issue I am having is that the MachineObjectOU.value is not being set, and when I move the alert into the switch statement that does not work either. The majority of this code is written for MDT2012, I take no credit for it, I am just trying to modify this bit to work best for my environment. <p><Select id=JoinDomain name=JoinDomain language=vbscript onchange="myfunction()" onpropertychange=ValidateDomainMembership accesskey=a> <option>Select Domain</option> <option value="crr.prod.crr.com">crr</option> <option value="prod.test.com">test</option> <option value="tail.prod.tame.com">tame</option> <option value="css.prod.tame.com">css</option> <label class=ErrMsg for=JoinDomain>* Required</label> </p> </td> </tr><script type="text/javascript"> function myFunction(){alert(JoinDomain.value); switch(JoinDomain.Value) { case "crr.prod.crr.com": MachineObjectOU.value="OU=Windows 7 Workstations,OU=Workstations,DC=crr,DC=prod,DC=crr,DC=com"; break; case "prod.test.com": MachineObjectOU.value="OU=Windows 7 Workstations,OU=Workstations,DC=prod,DC=test,DC=com"; break; case "tail.prod.tame.com": MachineObjectOU.value="OU=Windows 7 Workstations,DC=tail,DC=prod,DC=tame,DC=com"; break; case "css.prod.tame.com": MachineObjectOU.value="OU=Windows 7 Workstations,OU=Workstations,DC=css,DC=prod,DC=tame,DC=com"; break; }}</script> <tr> <td colspan=2></td> <td> </td> <td id=PopupParent> <input type=text id=MachineObjectOU name=MachineObjectOU size=60 language=vbscript onpropertychange=ValidateDomainMembership accesskey=O> <input type="button" id=MachineObjectOUOptionalBtn hidefocus="1" value="▼" style="height:23; width:16; font-family: helvetica; font-size: 7pt; display: none;" onclick="JavaScript:HideUnHideComboBox();"> <div id="PopupBox" style="position:absolute; display:none; z-index:10000; width: 240px; left: 250px;" > <select size="6" id="MachineObjectOUOptional" style="width: 100%; border-style: none" onchange="JavaScript:MachineObjectOU.value = this.value;" onclick="javascript:HideUnHideComboBox();"> </select>
×
×
  • Create New...