Re: Confused on Syntax



=?Utf-8?B?Sm9obiBRdWlubg==?= wrote on 10 mrt 2007 in
microsoft.public.scripting.jscript:

The following two examples do not work! What am I doing wrong.

var uuuuuu = document.FORM1.txtEnrl.value;
var vvvvvv = document.FORM1.txtNoSnrs.value;

if ((vvvvvv) > (uuuuuu)){


The value of a <input type=text> is ALWAYS a string.
Putting a string in () does not make it a number.
Comparing strings compares alphanumeric.

Try:

if (+vvvvvv > +uuuuuu){

I do as little as possible with Jscript, I am a vbScript man!

Then you should already know this,
as the same compare problem,
though not the solution,
goes for [clientside] vbs.

You see, doing some javascript can improve your vbs skills.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.



Relevant Pages

  • Re: Calculate the string statement
    ... verkn:(vkn:char; ... funkt:(fkt:string; ... var fkt,dfkt: p; ... var fehler: boolean; ...
    (comp.lang.pascal.borland)
  • Two new tests for MM B&V
    ... var RunningThreads: Integer; ... class function TStringThreadTest.GetBenchmarkDescription: string; ... function CheckPattern(const Dest: Pointer; const Size: Integer; const ...
    (borland.public.delphi.language.basm)
  • server-side JavaScript: Prototypes of built-in classes, objects and functins
    ... Session object (disk-based session variables for data persistence ... File class (manipulation of files on server, ie. open, close, read, ... //Methods Cgi.queryCgi.postCgi.anyby default return an empty string if requested var not found ...
    (comp.lang.javascript)
  • Re: [PHP] Image Generation
    ... the text, font, colour, maximum frame size (ie the width and height it ... var $xoffset, $yoffset, $margin; ... a string or array of strings. ... a float or an array of floats - which size to display the related text at. ...
    (php.general)
  • Re: Ajax -> javascript edit box display problems - please help
    ... Public Function GetUsernameList(ByVal testParam As String) As String ... successfully with the AutoComplete.js script. ... getLength: function{ ... var v = this.getValue); ...
    (comp.lang.javascript)