Re: VBScript versus JavaScript
- From: "Joe Fawcett" <joefawcett@xxxxxxxxxxxxxxxx>
- Date: Sun, 18 Jan 2009 11:01:03 -0000
var gc = document.FORM1.txtGCPHNO
gc holds a reference to the textbox. You can then access the .value to see the actual text.
var gc = document.FORM1.txtGCPHNO.value
gc holds the text of the textbox.
var gc = document.FORM1.txtGCPHNO.value.length
gc holds the length of the text in txtGCPHNO.
http://www.w3schools.com/htmldom/dom_obj_document.asp may help
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"Leona Leal Educator" <LeonaLealEducator@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:60CBC2A0-180B-4DA4-945B-173957F1247B@xxxxxxxxxxxxxxxx
I have trouble understand the objects.
Example
var gc = document.FORM1.txtGCPHNO.value.length; ' This works
var gc = document.FORM1.txtGCPHNO.value; ' This fails
There is also a difference between numeric and character data.
if (gc == 0)
}
When I use .length the abobe works,
When I drop .length, it fails.
I Java for applications it works, but not on a Web Page?
If you know of a manual that shows examples of fields entered via a web page
it would help a lot.
When I have done a little with Java for Applications, I have a lot less
trouble than I do with JavaScript.
I need to understand what the objects are looking for, In assembler I create
my own and never have problems.
In all honesty I wish they would use IBM Assembler instead of Java on the
Web. A lot less rules to remember.
Appreciate your input.
Thanks
Granny Leona
"Joe Fawcett" wrote:
"Leona Leal Educator" <LeonaLealEducator@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:DFB3A67B-BBE8-4E97-94CF-F51C03794965@xxxxxxxxxxxxxxxx
> Is there any way I can get away from using JavaScript?
>
> It is too difficult to find good manuals and far too time consuming
> understanding when I have to use JavaScript sub-routines.
>
> Does VBScript hava something that works like alert does in JavaScript?
>
> When someone enters a field incorrectly to display the message > immediately
> instead of calling a JavaScript sub-routine is an example.
>
> I have one form with 179 fields and I just cannot get all the checks > and
> balances to work.
>
> Thanks in Advance
>
> Granny Leona
If you are talking about using script in a browser then VBScript only works
in IE.
You can use alert because that's not a JavaScript method, it's a method on
the window object.
I'm surprised you say there's little documentation, I've seen much more on
JavaScript used in browsers.
VBScript is more usually used for general admin tasks when run as standalone
scripts in WSH.
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
.
- References:
- VBScript versus JavaScript
- From: Leona Leal Educator
- Re: VBScript versus JavaScript
- From: Joe Fawcett
- Re: VBScript versus JavaScript
- From: Leona Leal Educator
- VBScript versus JavaScript
- Prev by Date: Re: Reloading Original Page
- Next by Date: Re: ways to connect to MSSQL 2000 sever via vbscript
- Previous by thread: Re: VBScript versus JavaScript
- Next by thread: How do I create a mask for a phone #?
- Index(es):
Relevant Pages
|
Loading