August 10, 2001 at 9:09 pm
Hi guys,
does anyone know how to populate the page's text boxes and pull down menus using an initial pull down menu at the top without using a button? Is there any such way? Or do I really have to use the button thing? Right now, I have one that uses a button after the first pull down menu field which populates the data in the rest of the fields if the user clicks on the button.
Otherwise, is there any way to disable the text fields and buttons if the initial button is not clicked?
Marvin
August 11, 2001 at 7:28 am
I think we need more info. VB? ASP? what language? Is there a SQL issue involved?
Andy
August 11, 2001 at 7:04 pm
Have you looked into the onchange? I'm not too experienced with scripting in web pages, but I recall having done something along these lines a few years back. Here's a link, has to do with MS-centric development and it's flavor of design-time controls:
August 13, 2001 at 8:54 am
http://www.asp101.com http://www.15seconds.com are both good places to start for asp and db pulldown navigation.
August 13, 2001 at 7:57 pm
Hi guys,
i'm working in ASP in a Microsoft SQL Server environment. I dunno whether the Onchange event works in ASP but i do know that it works in VB.
Marvin
August 13, 2001 at 9:49 pm
Yes there is an onChange event in java Script. Just add the event handler to the tag. <SELECT name="dropDown" onChange="dropDownChanged()"> Then add the function dropDownChanged() in a <Script> section.
August 14, 2001 at 3:56 am
Yah I have found out about it already. Thnx dude. 🙂 But I have another question here : I am using Commandtext as the SQL statement. Is it possible to execute it like this:
Set rsbanner = newscmd.Execute ??
I have tried it but found that they are asking for the initialisation of my newscmd which i have initialised in a seperate include file.
my code looks something like this:
<SCRIPT LANGUAGE="VBSCRIPT">
Sub BannerType_onChange()
counter = AddBanner.BannerType.SelectedIndex
If counter = 1 Then
loc = "Top"
Else
If counter = 2 Then
loc = "Side"
Else
loc = ""
End If
End If
If loc <> "" Then
If loc = "Top" Then
newscmd.CommandText = "Select * From Banner_Top"
Else
If loc = "Side" Then
newscmd.CommandText = "Select * From Banner_Side"
End If
End If
Set rsBanner = newscmd.Execute
If not rsBanner.EOF or rsBanner.BOF Then
countban = 0
rsBanner.Movefirst
Do While not rsBanner.EOF
countban = countban + 1
rsBanner.MoveNext
Loop
End If
End If
AddBanner.ID_Num.Value = countban
End Sub
</SCRIPT>
Above is my function coding....Any idea why it is not working?
August 16, 2001 at 8:04 pm
Your sub is client side script is your include file initializing the connection object client side also? or is it maybe initializing it server side?
August 21, 2001 at 2:12 am
I dun really know whether it is on the server end or client side. My connection to db is all done in an include file which i call from all the seperate scripts.
Script looks something like this :
set rsConn = Server.CreateObject("ADODB.Connection")
rsConn.Open SQLdb
set newscmd = Server.CreateObject("ADODB.Command")
set newscmd.activeconnection = rsConn
Cheers,
Marvin
August 21, 2001 at 10:35 pm
Thats your problem. The connection is Server side and your <SCRIPT> is client side. They do not know about each other. Notice your code uses Server.CreateObject
CreateObject
The CreateObject method creates an instance of a server component. If the component has implemented the OnStartPage and OnEndPage methods, the OnStartPage method is called at this time. For more information about server components, see Installable Components for ASP.
Syntax
Server.CreateObject( progID )
Parameters
progID
Specifies the type of object to create. The format for progID is [Vendor.]Component[.Version].
Remarks
By default, objects created by the Server.CreateObject method have page scope. This means that they are automatically destroyed by the server when it finishes processing the current ASP page.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply