Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Dim Drop Down Select Box Value

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38927
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Dim Drop Down Select Box Value
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Dim Drop Down Select Box Value - 10/19/2006 9:00:23 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hi guys.

In my scripts i have the following lines of code.
 
Dim sDepartment

Dim
SDepartmentGroup

sDepartment =
"Commercial"

sDepartmentGroup =
"LN Commercial"
 
Now sDepartment & sDepartmentGroup are hard coded into each script and i have five of them each doing the same thing only different sDepartment = "Commercial" sDepartmentGroup = "LN Commercial"
 
How could i turn it into a drop down box with each of the departments i want to use and still have the department selected used as a Dim?
 
Many thanks to anyone whi can help

 
Just an update , here is the HTML code for the drop down if it helps anyone
 

<select size=
"1" name="Department">

<option selected value="0">Please Select</option>

<option value="1">Commercial</option>

<option value="2">Estates Succession And Trusts</option>

<option value="3">Family</option>

<option value="4">Litigation</option>

<option value="5">Real Estate</option>

<option value="6">Wealth Planning</option>

</select>


< Message edited by cjwallace -- 10/19/2006 10:48:40 PM >
 
 
Post #: 1
 
 RE: Dim Drop Down Select Box Value - 10/19/2006 11:42:57 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You can change a value of a variable without having to redim it. 

Dim msg
msg = "1"
msg = "2"
msg = "3"

Msgbox Msg

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to cjwallace)
 
 
Post #: 2
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 12:00:21 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hi Mate and thanks for the reply. I am a bit lost in all of this sorry

What i am trying to do is have

sDepartment = "Commercial"
 
take the Commercial bit from what is selected in the drop down menu from this bit of code

<select size="1" name="Department">

<option selected value="0">Please Select</option>

<option value="1">Commercial</option>

<option value="2">Estates Succession And Trusts</option>

<option value="3">Family</option>

<option value="4">Litigation</option>

<option value="5">Real Estate</option>

<option value="6">Wealth Planning</option>

</select>
 
Sorry if i have lost what you was trying to tell me



(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 1:45:05 AM   
  ginolard


Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
sdepartment = Department.Value

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to cjwallace)
 
 
Post #: 4
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 1:49:59 AM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
I believe that would give you the int and he wants the string that is displayed if I understand correctly.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ginolard)
 
 
Post #: 5
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 2:48:29 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Woud you guys like me to post the whole code?

(in reply to ebgreen)
 
 
Post #: 6
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 5:27:25 AM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
If you are trying to get whats inside <option></option> vice the value="", avoid it if you can, you'll have to manipulate a collection object.


      

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to cjwallace)
 
 
Post #: 7
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 7:07:35 AM   
  DiGiTAL.SkReAM


Posts: 1183
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Donno, but isn't that what XML is for?  i would elaborate, but I am not very strong with XML either, so will leave it to one of the Size 40XXXX Craniums that are floating around here.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to TNO)
 
 
Post #: 8
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 7:15:18 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hi guys.

i used

sdepartment = Department.Value

Thanks very much that worked a treat.

on to the next issue. so i now have sDepartment = Department.Value but i need to have the sDepartmentGroup take the value from sDepartment = Department.Value but add a LN to the begining eg

sDepartment = Department.Value
sDepartmentGroup =
LN Department.Value
 
Any ideas?

Thanks very much guys.

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 9
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 7:27:23 AM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
Something like:

sDepartmentGroup = "LN" & Department.Value

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to cjwallace)
 
 
Post #: 10
 
 RE: Dim Drop Down Select Box Value - 10/20/2006 7:32:07 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Cheers ebgreen i will give it ago

(in reply to ebgreen)
 
 
Post #: 11
 
 RE: Dim Drop Down Select Box Value - 10/25/2006 9:04:14 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hi ebgreen

I have put the code you said to try into the script but its not working. When the script runs and it gets to the part in the script where it reads the following , then it displays that no group exists.


Set objGroup = GetObject _
("LDAP://cn=" & sDepartmentGroup & ",OU=DEPARTMENTAL GROUPS,OU=LONDON,OU=SECURITY GROUPS,OU=EUROPE,OU=WITHERS,dc=WITHERS,dc=NET")
objGroup.PutEx ADS_PROPERTY_APPEND, _
"member", Array("cn=" & strCN & ",OU=" & sDepartment & ",OU=LONDON,OU=USERS,OU=EUROPE,OU=WITHERS,dc=WITHERS,dc=NET")
objGroup.SetInfo


Dim sDepartment

Dim
SDepartmentGroup
sDepartment = Department.Value
sDepartmentGroup =
"LN" & Department.Value

Any ideas?  i am thinking it is something to do with sDepartmentGroup = "LN" & Department.Value but not really sure what

Cheers

Craig



(in reply to cjwallace)
 
 
Post #: 12
 
 RE: Dim Drop Down Select Box Value - 10/25/2006 9:37:03 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Figured something out here.

What it is doing is making the group name all one word when it need to be two eg LN Commercial and what it is doing is making it LNCommercial

Any ideas as to how i can put a space between "LN" & Department.Value


Cheers



(in reply to cjwallace)
 
 
Post #: 13
 
 RE: Dim Drop Down Select Box Value - 10/25/2006 9:40:10 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
not to worry i have got it working.

I put  "LN " & Department.Value

Cheers

Craig

(in reply to cjwallace)
 
 
Post #: 14
 
 RE: Dim Drop Down Select Box Value - 10/25/2006 9:40:53 PM   
  ginolard


Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
sDepartmentGroup = "LN " & Department.Value

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to cjwallace)
 
 
Post #: 15
 
 RE: Dim Drop Down Select Box Value - 10/25/2006 10:29:41 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
tee hee we must have posted the same thing at the same time.


Thanks for the reply anyway :-)

(in reply to ginolard)
 
 
Post #: 16
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Dim Drop Down Select Box Value Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts