Jeff - thanks for the replies.  I tried this on my production server,
which runs T2K rather than W5, and got the same results.  

The code doesn't seem to be working as written, unless you got different
results than I did.

It does sometimes work using an OR, but an OR won't do what I need.  I
want it to go to the "Test Page for Telephone Validation" (where I would
have error messages telling them what to fix) only if the field contains
alpha characters.  An all-numeric entry or an empty field should bypass
the validation and go to the html that says "Next Page" (under the Else
action).

It's a moot point for me now, since I figured out a method to use the
regex metatag (which also doesn't work in an IF action), but I'll post
my testing results below for future reference, in case someone else
tries to use this.


Scenario 1)  (original setup)
Use "string is not empty AND isnum(string) = 0"
-no data entered:  string is empty, so should go to "Next Page" - WORKS
-alpha characters entered:  string is not empty and isnum=0, so should
go to "Test Page"        - WORKS
-numeric characters entered:  string is not empty and isnum=1, so should
go to "Next Page" - DOES NOT WORK, goes to "Test Page"

Scenario 2)  (change AND to OR)
Use "string is not empty OR isnum(string) = 0"
-no data entered:  string is empty; isnum=0, so should go to "Test Page"
- WORKS 
-alpha characters entered:  string is not empty, so should go to "Test
Page" - WORKS 
-numeric characters entered:  string is not empty, so should go to "Test
Page" - WORKS

Scenario 3)  (change isnum=0 to isnum=1)
Use "string is not empty OR isnum(string) = 1"  
-no data entered:  string is empty; isnum=0, so should go to "Next Page"
- WORKS*                
-alpha characters entered:  string is not empty, so should go to "Test
Page" - WORKS   
-numeric characters entered:  string is not empty, so should go to "Test
Page" - WORKS

Scenario 4)   (change OR to AND)
Use "string is not empty AND isnum(string) = 1"   
-no data entered:  string is empty, so should go to "Next Page" - WORKS 
-alpha characters entered:  string is not empty and isnum=0, so should
go to "Next Page" - WORKS 
-numeric characters entered:  string is not empty and isnum=1, so should
go to "Test Page" - DOES NOT WORK, goes to "Next Page"


*I tested everything a couple times before this round & this did NOT
work; all 3 scenarios went to the "Test Page".  I started completely
over to document results for this email & it worked this time around.



> -----Original Message-----
> From: Jeff Bohmer [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 05, 2003 7:53 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Witango-Talk: Help with data validation
> 
> 
> 
> If you change the "and" to an "or" in the IF action it works (@ISNUM 
> is 0, for an empty number, or alpha chars).  It looks like the code 
> is working as written, with both "and" and "or" operators.
> 
> - Jeff
> 
> 
> >The IF action (Elseifvalidation) is "('<@ARG ContactTelephone1><@ARG
> >ContactTelephone2><@ARG ContactTelephone3>'!='') and ('<@ISNUM
> >VALUE='<@ARG ContactTelephone1><@ARG ContactTelephone2><@ARG
> >ContactTelephone3>'>'='0')".
> >
> >ISNUM should equal zero if the phonenumber fields contain any alpha 
> >characters, and equal one if they're numeric only.  This does work - 
> >the Results HTML for that action shows the ISNUM value.
> >
> >However, it goes to that page no matter whether the data entered is 
> >numeric or alpha.  If you put "A" into one of the fields, it goes 
> >through the IF (should evaluate to "0=0") and the Results 
> show ISNUM=0. 
> >If you put delete the "A" and replace it with "3", it goes 
> through the 
> >IF (should evaluate to "1=0") and get the same results page showing 
> >ISNUM=1.
> >
> >
> >
> >>  -----Original Message-----
> >>  From: Jeff Bohmer [mailto:[EMAIL PROTECTED]
> >>  Sent: Friday, December 05, 2003 6:21 PM
> >>  To: [EMAIL PROTECTED]
> >>  Subject: Re: Witango-Talk: Help with data validation
> >>
> >>
> >>
> >>  Where in the TAF's execution does Witango think 1=0?
> >>
> >>  - Jeff
> >>
> >>
> >>  >OK, this is driving me nuts.  I've attached an example file with 
> >> the  >relevant pieces of my app.  >
> >>  >I'm trying to validate form data.  I may add javascript 
> validation
> >>  >later, but at the moment, I'd rather have it in Witango.
> >>  >
> >>  >I've got required field data validating fine - see the
> >>  >'If_P1_ValidationErrors' tacked on to the end.  My 
> strong preference
> >>  >would be to include all of the data validation in one IF action.
> >>  >
> >>  >I want to validate some fairly simple stuff on certain
> >>  fields - i.e.,
> >>  >valid telephone number, zipcode &  basic email formatting. 
> >>  I've tried
> >>  >various forms of pattern matching, but can't get any of 
> them to work
> >>  >within an IF statement.  So I thought I could at least check
> >>  to be sure
> >>  >the phone & zip fields were all numeric - but I can't even
> >>  get that to
> >>  >work.  Evidently, as far as I can tell from processing 
> the attached
> >>  >taf, Witango thinks that 0=0 and 1=0.
> >>  >
> >>  >Surely someone of you has done this stuff and can tell this
> >>  poor fool
> >>  >what I'm doing wrong.
> >>  >
> >>  >Thanks for any help you've got.  And a grand weekend to 
> those lucky
> >>  >devils who won't be working!
> >>  >
> >>  >jamileh
> >>  >
> >>  >
> >>  >  <<example.taf>>
> >>  >
> >>  >_____________________________________________________________
> >>  __________
> >>  >_
> >>  >TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
> >>  >Content-Type: application/octet-stream;
> >>  > name="example.taf"
> >>  >Content-Description: example.taf
> >>  >Content-Disposition: attachment;
> >>  > filename="example.taf"
> >>  >
> >>  >Attachment converted: Macintosh HD:example.taf 
> (????/----) (000F18AF)
> >>
> >>  --
> >>
> >>  Jeff Bohmer
> >>  VisionLink, Inc.
> >>  _________________________________
> >>  303.402.0170
> >>  www.visionlink.org
> >>  _________________________________
> >>  People. Tools. Change. Community.  
> >> ______________________________________________________________
> >>  __________
> >>  TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
> >>
> >_____________________________________________________________
> __________
> >_
> >TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
> 
> -- 
> 
> Jeff Bohmer
> VisionLink, Inc.
> _________________________________
> 303.402.0170
> www.visionlink.org
> _________________________________
> People. Tools. Change. Community. 
> ______________________________________________________________
> __________
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
> 
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to