Execute A Vbscript Sub Routine?
May 8, 2010
From inside a javascript function i need to execute a vbscript sub routine.
You might be thinking why i can't do it in javascript. well i probably can but i am better at VBscript and it would be a lot easier.
View 3 Replies
ADVERTISEMENT
Feb 23, 2004
Nowhere as complex as some of the scripts posted in this section, but just a little one I wrote. You just use three lines to create and render the barchart:
<html>
<head>
<title>Bar Charts</title>
<style>
.barchart {
table-layout:fixed;
font:normal normal normal small normal monospace;
}
.bar {
position:relative;
margin-bottom:0px;
width:45px;
background-color:#999999;
}
</style>
<script>
function Barchart(id) {
var entries=new Array();
var maxHeight=0;
var absoluteMax=300;
this.setEntries=function() {
for (i=0;i<arguments.length;i+=2) {
entries[i/2]=new Array();
entries[i/2][0]=arguments[i];
if (!isNaN(arguments[i+1])) {
entries[i/2][1]=arguments[i+1];// COULD USE toPrecision() for newer
maxHeight=(entries[i/2][1]>maxHeight)?entries[i/2][1]:maxHeight;
} else {
throw "Value of parameter "+(i+1)*1+" is not a number";
}
}
};
this.toString=function() {
var str="<table id='"+id+"' class='barchart' cellpadding=Ɖ' cellspacing=Ɔ' border=Ɔ'>"+
"<tr valign='bottom' align='center'>";
for (i=0;i<entries.length;i++) {
var h=parseInt((entries[i][1]/maxHeight)*absoluteMax)
str+="<td width=཮' valign='bottom' align='center'>"+entries[i][1]+
"<div class='bar' style='height:"+h+";background-color:"+Barchart.colors[i%Barchart.colors.length]+"'></div></td>";
}
str+="</tr><tr align='center'>";
for (i=0;i<entries.length;i++) {
str+="<td width=཮' align='center'>"+entries[i][0]+"</td>";
}
str+="</tr></table>";
return str;
};
}
Barchart.colors=new Array();
Barchart.colors[0]="blue";
Barchart.colors[1]="green";
Barchart.colors[2]="purple";
Barchart.colors[3]="brown";
</script>
</head>
<body>
Test Page for Bar Charts<br><br>
<script>
// THE CALL TO CREATE AND RENDER THE BARCHART IS BELOW - 3 LINES
var b=new Barchart();
b.setEntries("Anton", 30, "Angela", 55, "Cecile", 24, "Leon", 64, "Rosie", 18);
document.write(b);
</script>
</body>
</html>
View 1 Replies
View Related
Mar 23, 2011
I am creating a simple Web App using Helios (Eclipse).
It needs to do two things :
1) Accept an integer via a text box from the user
2) Call a mySQL routine (stored proc), via a button, and pass the integer from step 1 to this stored procedure. Return results to page.
How would I do this (mainly step 2) using JavaScript, or am I barking up the wrong tree?
View 1 Replies
View Related
May 9, 2011
I ve got a bit of a problem adding new options to select. It works fine out of the getJSON routine (see commented line) PHP data supplier returns proper values and alert displays them fine, but can not add them to select
Using Multiselect widget from - http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
and jQuery 1.6 + UI 1.82
[URL]
$("#1").bind("multiselectclose", function(event, ui){
var checked1 = $("#1").multiselect("getChecked").map(function(){return this.value;}).get();
if (checked1<1){
[Code]....
View 1 Replies
View Related
May 30, 2007
I there a quick routine that removes trailing newline chars and carriage return?
View 5 Replies
View Related
Jul 23, 2005
The user clicks on the delete icon, and gets a JavaScript client-side popup
to confirm that he wants to delete. I am passing this client-side function
a contactID.
Then, I want to send the result of this confirm (true|false) to a
server-side VBScript function, along with the contactID.
The VBScript function will then perform a delete in the database for the
specified contactID.
I have seen many examples about sending stuff back and forth between
JavaScript and VBScript, between server and client, but all the examples I
see are just popping up generic alerts and such. I need to execute some JS
on the client side, return a value, and send it to a VBScript function on
the server side.
View 3 Replies
View Related
Jan 20, 2011
how to convert below vbscript to javascript.
[Code]...
View 3 Replies
View Related
Aug 25, 2003
Is it possible to exchange data between Javascript and VBScript! In other words can they communicate!
View 4 Replies
View Related
Oct 17, 2005
I have some pages with this VBScript code, which obviously does not
work in Firefox. How can I convert this to Javascript in order for my
web page to work in Firefox ? It basically fills a drop down with a
list of dates that a user can select. Code:
View 2 Replies
View Related
Apr 4, 2009
Can I call a value from the database to javascript/vbscript. Let's say the database is called SQL="SELECT * from checkout".Can I validate that the SQL and the javascript/vbscript equals to each other and inside the javascript uses the response.redirect function to another asp page?
View 3 Replies
View Related
Dec 3, 2007
I need some help converting this VBScript over to JavaScript so that the calculations will work properly in browsers other than IE.
You can take a look at Turn 2 Design Code: for a feel about what I'm trying to do, but basicly, I just need to calculate the cost of the selected items based on the selected quantity of that item.
The only thing I know about JavaScript is the small Pop-up scripts I've been able to litterally copy and paste to implement. So, please, dont just post code, post an explaination of whats going on and why so I can try to figure it out. Code:
View 8 Replies
View Related
Jul 25, 2011
Im using the onchange event for a dropdown list to change SQL statements based on the index of that dropdown chosen. For example I have a function like this for my onchange event of the drop down list.
<script type="text/javascript">
function listboxchange(index)
declare connection ...
[code]....
View 2 Replies
View Related
Mar 21, 2005
Not sure whether this should go in the JavaScript or VBScript/ASP section, but I'll try here anyway.
I have an ASP include file that contains both VBScript and JavaScript code. The VBScript processes some information and has an onChange event which calls a JavaScript function. Within this javascript function I want to access a recordset and retrieve a value using a variable from the javascript. Here's the code from the JavaScript section. Code:
View 1 Replies
View Related
Sep 30, 2000
Just wondering if anyone knew if there was a definite speed advantage to VBScipt as opposed to JavaScript?
View 7 Replies
View Related
Jan 9, 2006
I am wondering if there is any way to write a VBScript macro for IE,
just like the action that we can do in MS Excel (Tools -> Macro ->
Visual Basic Editor).
Also, I believe we can automate actions to IE pages using VBScript,
like when you right click a web page and choose "Export to Microsoft
Excel". But I have no idea how to get it.
View 2 Replies
View Related
May 10, 2006
Could you help me in this problem:
I want to launch an exe file(executable jar file) from a web page. I use jsp...and i cannot use vbScript...? could u tell me how should i do it?
View 7 Replies
View Related
Mar 28, 2007
I'm looking to return DATE ONLY for yesterday's date. No seconds,
milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so
easily Date()-1 will return 03/27/2007 if today is 03/28/2007. Why so
many hoops for javascript? Any ideas?
View 21 Replies
View Related
Jul 20, 2005
I have the following function to get the total qty:
function calttl()
{
var ttlqty
ttlqty=0
for (i = 0; i <= document.qtymain.orderdetail.length-1; i++)
{
ttlqty = ttlqty + document.qtymain.qty.item(i).value
}
}
The problem I have is the document.qtymain.qty.item(i).value I get
look like a string, so the number I get for ttlqty is not add up the
number but concatenate.
How do I convert the value I get to a number in javascript?
View 8 Replies
View Related
Sep 23, 2005
Here is a compilation/creation/collection of recreated vbscript functions for use in JavaScript. Additions and criticism are of course welcome.
Zip file contains:
vbs.js
ReadMe.html
<Edit>Surprisingly there haven't been many downloads for this. Here's a quick overview of the contents:</Edit>
==================================================
==================================================
CreateObject(x)
Translates into: new ActiveXObject(x)
dateDiff(p_Interval, p_Date1, p_Date2,p_firstdayofweek, p_firstweekofyear)
Returns the number of intervals between two dates
datePart(p_Interval, p_Date,p_firstdayofweek, p_firstweekofyear)
Returns the specified part of a given date.
FormatCurrency(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)
FormatDateTime(datetime, FormatType)
FormatNumber(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)
FormatPercent(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)
InStr(strSearch,charSearchFor)
Returns the first location a substring SearchForStr that was found in the string str
isDate(p_Expression)
Left(string, length)
Returns a specified number of characters from the left side of a string.
Len(str)
Returns the number of characters in a string.
LTrim(str)
Returns a copy of a string without leading spaces.
Mid(str,start,len)
Returns a specified number of characters from a string.
monthName(p_Date, p_abbreviate)
Now()
Returns the current date and time.
Right(string, length)
Returns a specified number of characters from the right side of a string
RTrim(string)
Returns a copy of a string without trailing spaces.
Trim(strInput)
Removes leading and trailing spaces
weekdayName(p_Date, p_abbreviate)
================================================
================================================
View 1 Replies
View Related
Feb 3, 2011
I'm getting the following error in IE on my Adobe Presenter file: Message: Type mismatch: 'SlideContent_DoFSCommand'
What could be causing the error? The presentation plays fine, just getting the error.
View 1 Replies
View Related
Feb 4, 2005
I'm having a problem getting javascript and vbscript to place nicely together. Here is what I want to do:
I'm getting values from my database for different exam types. Here are some sample values:
Exam Type1
Exam Type2
Exam Type3
Here is how I get the values in vbscript: Code:
View 5 Replies
View Related
Apr 27, 2009
First of all, I'm sorry if I'm in the wrong group of discussion. I couldn't find discussion forum for vbscript. The problem I had is in vbscript coding.
The coding is as below:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
strDNSServer = WScript.Arguments(0)
strDomainName = WScript.Arguments(1)
[Code]...
View 1 Replies
View Related
Jul 23, 2005
I got two ASP pages. One is ASP email form (I'm using Persist ASP
Email component). Another one has all file links in it. For example,
when user click Outlook course hyperlink. It will pop up another
window with outlook course PDF file. (All PDF files are already in the
server).
What I am trying to do is: When user click the "Add Email" hyperlink,
it will add that course name and filepath into ASP/VBScript Dictioanry
Object. After the user finish and click "Attach to email" button. All
the files will be attached in the email as an attachment.
Because I am not familar with VBScript. So, can Javascript add items
to ASP Dictionary Object?
View 3 Replies
View Related
Sep 19, 2010
select sum(amount)as Total from studenttbli have wriiten above query ,now i need that amount sum in vbscript variable. i m not able to write tht i have written folowing but it is showing errortotal=sum.filed("Total")
View 1 Replies
View Related
Jan 16, 2011
My problem is i do not know the syntax for changing the button image when on click meaning when i click on a imagefield button it will change to another imagefield button and when i click again it will change back.I know that we have to create a function something like this?I am not sure of the syntax but will learn from you expertX - what to put in here?
function changeImage()
X
end function
[code]....
View 2 Replies
View Related
Dec 1, 2010
I've made a script for an intraweb, where I use VBScript aswel. (It's IE only)I need that VBScript to get some data from excel files... but then again, this data is passed to javascript where I use it in scripts.Everything works fine like this, when I pass the VB variable (shiftVB) to a javascript variable addthisvar:
Code JavaScript:
var addthisvar = shiftVB;
function dothisnow(addthisvar){
[code]....
View 2 Replies
View Related