[Javascript] how can I check to see if a text box has a number or a string in it???

Peter Brunone peter at brunone.com
Thu Jun 13 18:39:09 CDT 2002


Scott,

	A few questions/comments:

	What is the error?

	You don't have to say ==true; it's implied, i.e. you're asking for its
existence.

	Generally, your form will be subordinate to the document object, so you'll
need to say parent.FrameName.document.formName.fieldName.value (try putting
.document after TransDetail).

	Other than that, make sure your names and cases are correct, and if you
want to see if a form field value is numeric, don't forget to parseInt() or
parseFloat(); otherwise, everything will be a string.

Cheers,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Scott.Wiseman
|Sent: Thursday, June 13, 2002 6:24 PM
|To: 'javascript at LaTech.edu'
|Subject: [Javascript] how can I check to see if a text box has a number
|or a string in it???
|
|
|I am using a frame...
|
|and I am checking the bottom text box "ClosingYear"
|from the top frame...
|
|I get an error..
|
|is this not the correct way to use the function????
|
|//  if( isNaN(parent.TransDetail.myform.ClosingYear.value)==true )
|//        {
|//            alert("You must select a Year");
|//        return false;
|//        }
|_______________________________________________
|Javascript mailing list
|Javascript at LaTech.edu
|https://lists.LaTech.edu/mailman/listinfo/javascript
|




More information about the Javascript mailing list