Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Urgent Help On VBScript Combo Boxes

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Urgent Help On VBScript Combo Boxes
  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 >>
 Urgent Help On VBScript Combo Boxes - 4/2/2004 1:04:47 PM   
  sameery

 

Posts: 1
Score: 0
Joined: 4/2/2004
From: USA
Status: offline
Hi,

I have a webpage with a combo box(drop down) and two items (A and B). On the onChange() event of this combo box I am calling a vbscript function selVal() to select a value in another combo box. I have already populated(using HTML) the other combo box with 4 items (Select from this box...., Me, Myself and I - with 'Select from this box...' selected by default)

Now what the function should do is that if I select 'A' from the first combo box it should display 'Me' in the other combo box and If I select 'B' from the first combo box it should select 'Select from this box....' in the second combo box and allow me to select from the items in the combo box.

HTML Code

first combo box:
----------------


second combo box:
----------------



VBScript Code:
--------------
Sub selVal()
Dim dfrm1, firstVal

Set dfrm1 = document.form1 //set document.form to a variable
firstVal = UCASE(dfrm1.firstCombo.Value)

Select Case firstVal
Case "A"
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).text = "Me"
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).value = "10"

Case "B"
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).text = "Select from this box...."
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).value = " "

Case Else
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).text = "Select from this box...."
dfrm1.secondCombo.options(dfrm1.secondCombo.SelectedIndex).value = " "

End Select
End Sub


But its not giving me the necessary functionality. Please try and help.

Thanks

Sameer
 
 
Post #: 1
 
 Re: Urgent Help On VBScript Combo Boxes - 4/2/2004 4:11:25 PM   
  ghaneipour

 

Posts: 25
Score: 0
Joined: 9/6/2001
From: Iran
Status: offline
quote:

Originally posted by sameery

Hi,
hello. you must use same name for id and name of object (ucase or other) . and you must use id in your form and .... such as this sample.
you can tell me by email.pedram@supportlock.com






Hi,





second combo box:

----------------








VBScript Code:
--------------


hello to all
ghaneipour
EC OaCa
?CaUi ??N

(in reply to sameery)
 
 
Post #: 2
 
 
 
  

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 >> Urgent Help On VBScript Combo Boxes 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