Search This Blog

Loading...
Showing posts with label VBScript. Show all posts
Showing posts with label VBScript. Show all posts

Monday, September 8, 2008

Call VBScript in Javascript

Well, it's actually working fine in IE but not other browser. As we all know, client side vbscript is microsoft product and it's only support in IE.

Try this,

<HTML>
<HEAD>

<SCRIPT LANGUAGE=vbscript>
Function vbFunc()
Msgbox("VBScript: Vb function")
End Function

</SCRIPT>

<SCRIPT LANGUAGE=javascript>

function jsFunc()
{
alert("Javascript: jsFunc function");
vbFunc();
}

</SCRIPT>

</HEAD>
<BODY onload="jsFunc()" >
</BODY>
</HTML>

Saturday, April 19, 2008

VBScript: Open new windows (IE)

To open new window using client side vbscript,
use open "url", "target", "options"

example:

Sub fnOpenUrl(url)

open url ,"newWindow", "toolbar=no, menubar=no, status=no, width=830, height=660 titlebar=no, scrollbars=yes, resizable=yes, top=5, left=5 "

End Sub

to call the function

fnOpenUrl("http://www.xincrm.com")

Done.

Saturday, March 1, 2008

VBScript: disabled and enabled button

<html>
<head>
<title>VBScript Example: disabled and enabled button</title>
<SCRIPT Language="VBScript">
sub enableButton()
if frm.chkbox_1.checked = true then
frm.btn_1.disabled = false
else
frm.btn_1.disabled = true
end if

end sub
</SCRIPT>
</head>
<body>
<form name=frm>

<input type="checkbox" name="chkbox_1" value="ON" onclick="enableButton()"></input>
<input type="submit" value="I Agree" name="btn_1" disabled></input>

</form>
</body>
</html>

Sunday, February 17, 2008

Get value from dynamic (number) radio button using vbscript

Here is my scenario, i have a ratio button but i'm not sure how many radio button will be populated. It can be one or it can be more than one (Array). I've tried many way to make it work but fail. Finally come out with below work around.

On Error Resume Next
radCount = document.all.RadDynamic.length
If err.number <> 0 then
If document.all.RadDynamic.checked Then
strLogoID = strLogoID & "," & document.all.RadDynamic.value
End If
Else
For i=0 To document.all.RadDynamic.length -1
If document.all.RadDynamic(i).checked Then
strLogoID = strLogoID & "," & document.all.RadDynamic(i).value
End if
Next
End If

Friday, January 25, 2008

VBScript New Line

I do have some projects that written in Classic ASP. I come accross the case that need to draw NewLine in Classic ASP.

Response.Write (vbCrLf) solve my problem