Zopists, I am trying to check an see if an email address has an @ sign in it as a hack way of determining validity. I checked the dtml ref guide, and found the find(S,SUB[,START]) method of the string module. I am having me luck geting it to process. I have an variable int the namespace called 'email_address' (original, huh) I then try to call a conditional like so: <!--#if "_.string.find(email_address,@)==-1"--> It's not valid! <!--#else--> It is! <!--#/if--> It can't parse the DTML because of a Python syntax error. I am probably misunderstanding the way to call the find method of the string mocule. Any ideas? Jason Spisak
At 11:54 AM 9/3/99 -0800, Jason Spisak wrote:
<!--#if "_.string.find(email_address,@)==-1"--> It's not valid! <!--#else--> It is! <!--#/if-->
Try: <!--#if "_.string.find(email_address,'@')==-1"--> You've gotta have quotes around a string literal.
Phillip and Kevin, Yes I'm that stupid. To go that far into it, and miss the '' literal. Eating always helps. Thanks, you guys. All my best, Jason Spisak "Phillip J. Eby" wrote:
At 11:54 AM 9/3/99 -0800, Jason Spisak wrote:
<!--#if "_.string.find(email_address,@)==-1"--> It's not valid! <!--#else--> It is! <!--#/if-->
Try:
<!--#if "_.string.find(email_address,'@')==-1"-->
You've gotta have quotes around a string literal.
participants (2)
-
Jason Spisak -
Phillip J. Eby