Test Form for Integers

Results 1 to 2 of 2

Thread: Test Form for Integers

  1. #1
    Team Red Guest

    Default Test Form for Integers

    Hi, I want to see if a form has only integers, I can use isNumeric() but then a float could have been entered, I guess I can then search for a "." but that&#039s silly. I need to use the integer for an ID(int) in a SQL database. I can use Fix() but then a float would still be a vlid ID which is undesirable. Please help!

  2. #2
    lucy bage Guest

    Default RE: Test Form for Integers

    Try the following code:<BR><BR>field1=Request.Form("Field1") <BR><BR>If IsNumeric(field1) Then <BR>If Int(field1)=field1 Then<BR>...<BR>End If<BR>End If<BR><BR>If the integer value is the same as the value then it is an integer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts