473,395 Members | 1,462 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,395 software developers and data experts.

checking for which button is pressed

I have a file upload tool.

Before I save the file to a directory on the server, I first check to see if
that file exists. If it does, I exit out of the 'save' function and display
a different panel that will say:

==============================================
File exists. Do you want to save over the current file?
[ Save Over] [ Cancel ]
==============================================

I want to be able to check to see which button was selected. I could easily
do this if they were radioButtons, as I'd just check to see which one was
selected. Is there an equivalent for buttons? Or do I have to do something
more complex like setting a public string to a value based on the event
handlers for each button?

-Darrel
Nov 18 '05 #1
3 1712
If you're doing an ASP page, just create two server side buttons, and add
code to their event handlers.

"darrel" <no*****@hotmail.com> wrote in message
news:ui**************@TK2MSFTNGP12.phx.gbl...
I have a file upload tool.

Before I save the file to a directory on the server, I first check to see if that file exists. If it does, I exit out of the 'save' function and display a different panel that will say:

==============================================
File exists. Do you want to save over the current file?
[ Save Over] [ Cancel ]
==============================================

I want to be able to check to see which button was selected. I could easily do this if they were radioButtons, as I'd just check to see which one was
selected. Is there an equivalent for buttons? Or do I have to do something
more complex like setting a public string to a value based on the event
handlers for each button?

-Darrel

Nov 18 '05 #2
> If you're doing an ASP page, just create two server side buttons, and add
code to their event handlers.


The issue is that a function is run either way. I think the solution is on
the handler, set a variable, THEN call the function...

-Darrel
Nov 18 '05 #3
Well, for good'ol manual HTML controls, you could do this:

<input type="submit" name="save_over" value="Overwrite">
<input type="submit" name="save_over" value="Cancel">

Notice that the two inputs have the same name.

Then, when you want to check to see if they clicked Overwrite, do this:

If Request.Form("save_over") = "Overwrite" Then
..
..
..
End If
The comparison is case sensitive
"darrel" <no*****@hotmail.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
If you're doing an ASP page, just create two server side buttons, and add code to their event handlers.


The issue is that a function is run either way. I think the solution is on
the handler, set a variable, THEN call the function...

-Darrel

Nov 18 '05 #4

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

Similar topics

7
by: - ions | last post by:
I have created a JComboBox with its Items as a list of "M" numbers ie. M1,M2,M3.......throgh too M110 (thes are the messier objects, a catolouge of deep sky objects) the user selects of of these...
8
by: Syed Ali | last post by:
Hello, I have 1 HTML form with 4 submit buttons and 10 textfield entry areas. If submit button1 is pressed I need to make sure that all 10 textfield entries have been filled before submitting...
3
by: James McGivney | last post by:
I have a project in VS.NET using C# I have a series of buttons on an aspx page. When one of the buttons is pressed, a panel becomes visible and allows the user to enter and edit data. I want to...
4
by: actionwoman63 | last post by:
Dear all I need to be able to check which one out of two submit buttons within the same form was pressed in a javascript function prior to form submission. And before I get flamed for not...
4
by: MJW | last post by:
Is there a way for me to know if or which command button was just clicked that triggers the LostFocus event for the current control on a Form? I have a form that has many types of users who each...
8
by: Jack Addington | last post by:
I want to scroll through the alphabet in order to scroll some data to the closest name that starts with a letter. If the user hits the H button then it should scroll to the letter closest to H. ...
7
by: Amadelle | last post by:
Hi all and thanks in advance, I am stuck! I can't figure out how to identify which button was clicked on my ASP.NET page in the PostBack event? So what I am trying to do is to is to have an if...
19
by: darrel | last post by:
On my vb.net page, I have 4 sets of inputs + form buttons. example: Search: (GO) Zip: (GO) County: (GO) County: (GO) The problem is if I go to the page, type in a zip code, and hit...
1
by: adamsalata | last post by:
Hi I'm wrting a simple calculator in C# using Windows Forms and I'm learning it now. I have one question. Is there any way to chceck if specified button was pressed? I know that I have event...
4
by: F159753 | last post by:
I have the following code: <script type="text/javascript"> function displayRow(){ var ET = document.getElementById("ExpenseTable"); var row3 = document.getElementById("searchbutton"); ...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.