Re: VBScript versus JavaScript



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





.



Relevant Pages

  • Re: GridView/FormView Issue
    ... on Page_Load event you need to ADD a javascript to the textbox so it will perform an action everytime the user writes a letter or deletes a letter, for that you add in the Page_Load this: ... var min = 10; ... Now, to enforce the user to update more than the minimum characters, all you need is to validate before update, ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: client side vs server side events for controls
    ... Just one further question regarding VBScript - everyone keeps ... > generate their own javascript to do so. ... >> date when that textbox loses the focus. ... At the moment I'm doing this in the server side TextChanged ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: client side vs server side events for controls
    ... Client-side VBScript is not supported by all browsers. ... JavaScript is. ... >>> date when that textbox loses the focus. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: "Professional Javascript" review
    ... a null value is an empty object pointer" ... In java ... might be better off abandoned for javascript programming. ... var a, b, c, d, ...
    (comp.lang.javascript)
  • Re: on page exit
    ... of which JavaScript is only one. ... used in HTML with intrinsic event handler attribute values, ... var clickedLink = null; ...
    (comp.lang.javascript)

Loading