Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I write two functions to a button?

Status
Not open for further replies.

tlw432

Technical User
Aug 23, 2009
1
US
Hello all,

I am new to this so I am wondering how I write or if it is possible to write two functions to a button?

Although I realize I should have the user confirming they want to delete the record.
I am not very familiar with the if or else statements.

What I have is an asp page which the code can be viewed at the link below.


The button is supposed to delete the record in the database. Which it does, but I would like for it to also send me an email letting me know that the record has been deleted.

Is this best done by calling a JavaScript function? Or how do I achive this? Your help is greatly appreciated. Any suggestions or possibilities! :)
 
That would be best done using ASP.

It really has nothing to do with Javascript, or even assigning two functions to a button. Your button just sends the data to the processing script, once the script portion is done deleting the record, that same ASP script should be the one to send the email.






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
vacunita said:
That would be best done using ASP.

It really has nothing to do with Javascript

Unless, of course, the OP is writing their ASP using JavaScript - which is my preferred language of choice when writing ASP...

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Unless, of course, the OP is writing their ASP using JavaScript - which is my preferred language of choice when writing ASP...
huh? really?

Why would you use one language to write another.

Doesn't sound semantic to me Dan :p

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hi

1DMF said:
Why would you use one language to write another.
Huh ? Dan mentioned only one language there : JavaScript. Note that ASP is not a language.
Active Server Pages said:
Most ASP pages are written in VBScript, but any other Active Scripting engine can be selected instead by using the [tt]@Language[/tt] directive or the [tt]<script language="language" runat="server">[/tt] syntax. JScript (Microsoft's implementation of ECMAScript) is the other language that is usually available.
( Active Server Pages article on Wikipedia. )

Feherke.
 
ooh, my mistake.

I did the stereotypical thing of assuming they meant the MS web language as you say VBScript.

So I guess PHP is ASP then. nes pas?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
PHP is a completely different technology. PHP is a language, while ASP is a technology that can be implemented with several languages.

ASP.NET isn't just VB.NET, either. You can use C#, VB.NET, and JScript.NET (which isn't the same as JScript) for ASP.NET, and probably any other .NET language that's installed on the web server.

I also use Javascript almost exclusively for classic ASP programming, and PerlScript (not Perl) and PythonScript (not Python) is available if the engine is installed on the web server.

Lee
 
well you learn something new everyday!

from what I understand you can use PERL, COBOL and a whole load of other languages via the .NET framework.

I think i'll stick with what i know ;-)



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 

In any case, my point still remains. The script that processes the data, should be the one to send the email. And while you can assign two actions to the button, I would think it be better to have that same script handle both actions.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top