Can I use VBScript instead of JavaScript in FrontPage?

B

Bill

The book I have on FrontPage talks a lot about using JavaScript but
hardly any about VBScript.

Can I use a VBScript to validate dates in a web page?

Thanks.
 
T

Thomas A. Rowe

Only if you are running the VBScript server-side in ASP / ASP.net, otherwise you are limiting your
site to IE users under Windows only.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
B

Bill

Only if you are running the VBScript server-side in ASP / ASP.net, otherwise you are limiting your
site to IE users under Windows only.

I have a limited number of users and they will all be using
IE/Windows.

Can you point me a FrontPage sample using vbScript? I guess I would
just do it like a javascript except change the "scripting language
name" to vbscript?

Thanks.
 
T

Thomas A. Rowe

Under the FP extensions on your local machine you would have to set the Default Scripting language
to VBScript (Tools |Web / Site Settings). This will then write all FP generated scripts, such as,
form field validation in VBScript, instead of the default JavaScript. If you are working with a
disk-based web locally you will not see this option, at least I don't under FP2000.

Is there a specific reason why you must use VBScript client-side instead of the internet default
client-side JavaScript?

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
B

Bill

Under the FP extensions on your local machine you would have to set the Default Scripting language
to VBScript (Tools |Web / Site Settings). This will then write all FP generated scripts, such as,
form field validation in VBScript, instead of the default JavaScript. If you are working with a
disk-based web locally you will not see this option, at least I don't under FP2000.

Is there a specific reason why you must use VBScript client-side instead of the internet default
client-side JavaScript?

As a VB programmer, VBScript is more intuitive for me and easier to
work with. It has certain built-in functions that are not available
in JavaScript.

Thanks.
 
B

Bill

Just as a matter of curiosity, what functions are lacking in javascript?

Just as an example for validating a page, IsDate( ) in VBScript will
return whether or not the parameter is a valid date.

I looked through the Java Script books and couldn't find a similar
function.

Is there one? However, I am just used to using VBScript in other
non-web projects. If there is a compelling reason, I would do so.
Again, being only usable by Microsoft / IE is OK.

I also read that if a client does not use MS/IE, the validation script
will run on the server. Is that true?

Thanks.
 
T

Thomas A. Rowe

Bill,

Don't know if the above is true, but it will be easy to test once you have a page on line.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
B

Bill

Bill,


Don't know if the above is true, but it will be easy to test once you have a page on line.

Thanks, Thomas.

Can you help me with this one?

Thanks again.
 
S

Steve Easton

There is one, it's hard to find though
Using Windows Explorer browse to: C:\Program Files\Microsoft Office\OFFICE11\1033
Double click the file: JSCRIPT5.CHM
Click the Index tab
Scroll down to: Date object constructor and click to open the page.
Click: See Also.
Click: Date Object Methods.
Scroll down and click: toLocaleString Method


--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
T

Thomas A. Rowe

Yes, I can help you or you can download and install FireFox, Netscape or Opera to test with.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
B

Bill

Yes, I can help you or you can download and install FireFox, Netscape or Opera to test with.

I meant could yo upoint me to a sample vb Sdcript in FrontPage.

The audience for this web site is restricted and will only use IE and
no other browsers.
 
B

Bill

There is one, it's hard to find though
Using Windows Explorer browse to: C:\Program Files\Microsoft Office\OFFICE11\1033
Double click the file: JSCRIPT5.CHM
Click the Index tab
Scroll down to: Date object constructor and click to open the page.
Click: See Also.
Click: Date Object Methods.
Scroll down and click: toLocaleString Method

Thank you very much.
 
B

Bill

There is one, it's hard to find though
Using Windows Explorer browse to: C:\Program Files\Microsoft Office\OFFICE11\1033
Double click the file: JSCRIPT5.CHM
Click the Index tab
Scroll down to: Date object constructor and click to open the page.
Click: See Also.
Click: Date Object Methods.
Scroll down and click: toLocaleString Method

I'm sorry. I didn't explain this correctly.

I know how to write a vbScript function.

How do I insert a vbScript into the HTML using FrontPage?

Or do I do it manually? If so, where does it go int the HTML code?

I meant to ask for a sample HTML file containing a vbScript function.
There, I think I got it right this time. <grin>

Thanks again.
 
B

Bill

In FrontPage, with the page opened in the editor, click Tools,
Scroll down to Macro, in the menu that opens to the right click Visual Basic Editor.

That's what I need! Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top