Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 14th, 2004, 11:38 AM
Authorized User
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default Number range using JavaScript

I need a code example of a Javascript function that will test for a number range that can include whole numbers and decimals. I am not a Javascript programmer but I do have a function that was written for me that is part of this validation that I am including as an example. This validation is made against several functions. Here is the example that has nothing to do with a number range:

function validInt(formField,fieldLabel,required)
    var result = true;

    if (required && !validRequired(formField,fieldLabel))
        result = false;

     if (result)
         var num = parseInt(formField.value);
         if (isNaN(num))
             alert('Please enter a number for the "' + fieldLabel +'" field.');
            result = false;

    return result;

Old December 14th, 2004, 08:35 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post

not use some Regular Expressions to do this for you ? (see http://builder.com.com/5100-6371-1049625.html)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a number range from tag attribute group maikm XSLT 6 August 25th, 2008 04:54 PM
Counting Number of Rows Between Data Range eusanpe Excel VBA 6 September 21st, 2006 07:17 AM
Subscript out of range: '[number: 0]' jim_h Classic ASP Professional 0 February 24th, 2006 07:24 PM
Subscript out of range: '[number: 49]' hameed Classic ASP Databases 2 August 5th, 2004 08:32 AM
Determining page number of a range name santon198 Excel VBA 0 May 10th, 2004 01:20 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.