C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to call Two JavaScript Functions for One Button on onclick event


Posted Date: 07 Sep 2008      Total Responses: 4

Posted By: Gaddamchandrakanth       Member Level: Silver     Points: 1



Hi,

This is from Chandrakanth.

I have one problem with Javascript Function.

I Have one UpDateButton in Aspx.vb page.

And i want to call 2 java script functions at a time,when i click on UpDate button.

The Functions are namely
1. ThirdParty_Delete();
2. Validation();

How can i write that?

For one function i have written like in this format.
btnUpdate.Attributes.Add("onClick", "return Validation();")

For 2 functions how can we can i go for that ?

Can any one give me reply as early as possible..

Thanks and Regards
Chandrakanth










Responses

Author: venkat    08 Sep 2008Member Level: GoldRating:     Points: 1

Try to write the both functions in one function


Author: UltimateRengan    08 Sep 2008Member Level: DiamondRating:     Points: 10

hi,

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Button1.Attributes.Add("onclick", "alertbox();confirmbox();")
End Sub
End Class



<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type ="text/javascript" >
function alertbox()
{
alert("This is first function");
}
function confirmbox()
{
confirm ("This is second function") ;
}
</script>
</head>


UltimateRengan
nathan.rengan@gmail.com
Trichy-Rider Group



Author: AbidiP    08 Sep 2008Member Level: GoldRating:     Points: 3

try this

btnUpdate.Attributes.Add("onClick", "return Validation(),ThirdParty_Delete();")

bye



Author: ANIL PANDEY    08 Sep 2008Member Level: DiamondRating:     Points: 2

hi,

u can call on function in the Button click and for calling the other one , u can use the function call in the first function..

Call the Second function inside the First function.. that means if ur First Function work is Over u can call the other function from the same function....

like

function ThirdParty_Delete()
{

//Perform the work u want to do

Validation();
}


hope u Got the idea..


Regards
Anil Pandey

Thanks & Regards
Anil Kumar Pandey



Post Reply
You must Sign In to post a response.
Next : to make sliding menu in JavaScript
Previous : javascript
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use