473,837 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select OnAction in ASP?

Hi.

I'm woundering if it's possibel to transfer a OnAction value from a
drop-down box in an ASP page without having to use Java code?

I mean something like this:

<%

Sub resposeprocess
some code,......
End Sub

%>

<Select name="DropDownM enu onAction="respo nseprocess">
<Option value="1">Value 1</option>
<Option value="2">Value 2</option>
</Select>

Can i get holds of the value from the drop-down box and use it inte the
subroutibe?

/Johan Ch
Jul 19 '05 #1
2 1542
No, not really. See, with the way ASP works, there is no "built-in" way to
interact between client and server. How things work is:
1. Browser enters URL, which in turn sends an http request to a server.
2. Server receives request, loads the page, runs any ASP code that may be
in it.
3. After all the code is run or a Response.End is reached, the resultant
HTML is sent back to the client (browser) that made the request.

So, you see, by the time your onAction (what's that?) event happens, there
is no server sitting there connected to the browser waiting for a subroutine
call. You have to have the browser make another request to the server. For
example:

<%
If Request.Queryst ring("choice") <> "" Then Call resposeprocess( )
Sub resposeprocess( )
''some code
Response.Write "Sub routine ran."
Response.Write "<br>Option chosen: " & Request.Queryst ring("choice")
End Sub
%>

<select name="DropDownM enu"
onchange="locat ion.href='thisp age.asp?choice= '+this.value;">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
</select

So, that's using JavaSCRIPT, which you didn't want to do, but you either
have to use that or encapsulate this in a form with a submit button that the
user will have to click on to send the new request to the server.

Ray at home

"Johan Christensson" <jo************ ****@telia.com> wrote in message
news:OF******** *****@TK2MSFTNG P14.phx.gbl...
Hi.

I'm woundering if it's possibel to transfer a OnAction value from a
drop-down box in an ASP page without having to use Java code?

I mean something like this:

<%

Sub resposeprocess
some code,......
End Sub

%>

<Select name="DropDownM enu onAction="respo nseprocess">
<Option value="1">Value 1</option>
<Option value="2">Value 2</option>
</Select>

Can i get holds of the value from the drop-down box and use it inte the
subroutibe?

/Johan Ch

Jul 19 '05 #2
On Wed, 29 Sep 2004 02:20:18 +0200, "Johan Christensson"
<jo************ ****@telia.com> wrote:
I'm woundering if it's possibel to transfer a OnAction value from a
drop-down box in an ASP page without having to use Java code?
Sure. It could be JavaScript, ActiveX or anything else tht will
operate on the client side. :)
I mean something like this:

<%

Sub resposeprocess
some code,......
End Sub

%>

<Select name="DropDownM enu onAction="respo nseprocess">
<Option value="1">Value 1</option>
<Option value="2">Value 2</option>
</Select>

Can i get holds of the value from the drop-down box and use it inte the
subroutibe?


No. The ASP page is processed and sent to the client. Then the
client changes something. The ASP is done, so the client has to
trigger sending something to the server. Which means some type of
client side code, be it Java, JavaScript, ActiveX or a "Submit"
button.

Jeff
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
5644
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures changed to be like:
1
4257
by: G.Gerard | last post by:
Hello Does anyone know how to write a function name with arguments in the OnAction of a command bar button: Example: Public Sub MyFunction(strMsg as String) Msgbox strMsg
3
3616
by: Paul | last post by:
This is MS Access 2002. I am creating some custom buttons on a CommandBar for a form. Below is the code. It works fine except that the OnAction procedure is executed twice. Why? How can I fix this? Private Sub cmdCreateTestToolBar_Click() On Error Resume Next CommandBars("Test Toolbar").Delete On Error GoTo ErrorFound
6
9522
by: Ken | last post by:
Please help I've been working on this for over a day. The following code will run the GetComments function from a shortcut menu. .MoveFirst Set cmb = Application.CommandBars.Add("Comments", msoBarPopup, , True) Do While Not .EOF Set cbc = cmb.Controls.Add(msoControlButton)
4
8293
by: Vincent | last post by:
I was wondering if the CommandBarButton OnAction property would allow you to specify a function from a module to be called. According to the post made by Turtle in 1998, the OnAction property can only specify a macro name. Is this still the case? I agree with Turtle that "this is pretty funky." -Vincent From: Turtle - view profile Date: Sat, Nov 21 1998 4:00 am
1
2973
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the select return in a cursor, tried setting the values for each field with a separate select. Think I've just got the syntax wrong. Here's one of my attempts: use ESBAOffsets go
1
2153
by: ApexData | last post by:
I have a ShortCutMenu that is made available on the RightClick of the mouse. The OnAction property has my custom function: =ComboBoxEditor() I believe that, in the ONAction property, I could do something like this to allow or prohib the use of the function??? =iif(blnUseThis,ComboBoxEditor(),Msgbox "NotAvailable") Is there a way to enable or disable the actual menu option from even showing on the rightclick of the mouse. For example
6
3398
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of the select was "111" and not "43+34+22+12".
2
2602
by: grusso | last post by:
well, i need a table with all functions for onaction sentence. where i can obtain? thank yourssss
0
9696
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10288
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7824
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7014
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4481
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3128
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.