473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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="DropDownMenu onAction="responseprocess">
<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 1526
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.Querystring("choice") <> "" Then Call resposeprocess()
Sub resposeprocess()
''some code
Response.Write "Sub routine ran."
Response.Write "<br>Option chosen: " & Request.Querystring("choice")
End Sub
%>

<select name="DropDownMenu"
onchange="location.href='thispage.asp?choice='+thi s.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*************@TK2MSFTNGP14.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="DropDownMenu onAction="responseprocess">
<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="DropDownMenu onAction="responseprocess">
<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
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...
1
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
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...
6
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",...
4
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...
1
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...
1
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...
6
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...
2
by: grusso | last post by:
well, i need a table with all functions for onaction sentence. where i can obtain? thank yourssss
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.