Search All Articles Submit your Website or Blog to A New Internet Library
Sunday, May 24, 2009
Calling VB Script Function from inside a Javascript function.
Calling VB script function in javascript is as simple as calling another javascript function.
Let us see with a simple example.
First we will create a function in VB Script to add two numbers.
Call this VB Script function from javascript
Following is html page to input values to add and shows the result in other
<html>
<head>
<script language="VbScript">
Function Add(a,b)
Add=CInt(a)+CInt(b)
End Function
</script>
<script language="JavaScript">
function callingVbfun()
{
document.getElementById('txtResult').value= Add(document.getElementById('txtNumber1').value,document.getElementById('txtNumber2').value)
}
</script>
</head>
<body></body>
<form>
<input type-"text" id="txtNumber1"/>
<input type-"text" id="txtNumber2"/>
<input type-"text" id="txtResult"/>
<input type-"button" id="btn" value="Add" onclick="callingVbfun()"/>
</form>
</html>
Subscribe to:
Post Comments (Atom)
Also Read other Top Articles
- JSON Serialization in VS 2008
- Implementing Forms Authentication in Silverlight Application.
- Making GridView Rows or Individual Cells Clickable and Selectable.
- Enabling browser back button for GridView Paging and Sorting in Ajax 1.1 and 3.5 (using Visual Studio 2005/ Visual studio 2008)
- How to pass values from User Control to Page or calling Page methods from User Control.
- What is WCF?
- New features in C# 4.0
- C# to VB.NET and VB.NET to C# online free converter tools.


0 comments:
Post a Comment
Post your comments/questions/feedback for this Article.