> [ShowIf [Lookup >db=BldrUsers.db&value=[Uppercase][UserName_][/Uppercase]&lookinfield=UserNa>me&ReturnField=UserName&NotFound=]=[Uppercase][UserName_][/Uppercase]]> This User Name Already Exists. Try Another!> [/ShowIf]>>It works fine, meaning it functions, but the string This User Name >Already Exists. Try Another! shows no matter what. I want to show this >only if the name exists.>>Is there an easier way to do an If Else type thing?Since your lookup for if the name exists occurs after the append, it will *always* be true. The following doesn't do an if/then/else (which would be a great 4.0 addition, hint, hint ; ) but by storing the state of the first lookup in a text variable, you can test it later without it being effected by the append.[text]UserName_Caps=[Uppercase][UserName_][/Uppercase][/text][text]UserName_Test=[Lookup db=BldrUsers.db&value=[UserName_Caps]&lookinfield=UserName&ReturnField=UserName&NotFound=][/text][ShowIf [UserName_Test]![UserName_Caps]][Append db=BldrUsers.db]UserName=[UserName_Caps]&PassWord=[PassWord_]&EmailAddr=[EmailAddr_][/Append]User Added[/ShowIf]
[ShowIf [UserName_Test]=[UserName_Caps]]This User Name Already Exists. Try Another![/ShowIf]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Associated Messages, from the most recent to the oldest:
|
> [ShowIf [Lookup >db=BldrUsers.db&value=[uppercase][UserName_][/Uppercase]&lookinfield=UserNa>me&ReturnField=UserName&NotFound=]=[uppercase][UserName_][/Uppercase]]> This User Name Already Exists. Try Another!> [/ShowIf]>>It works fine, meaning it functions, but the string This User Name >Already Exists. Try Another! shows no matter what. I want to show this >only if the name exists.>>Is there an easier way to do an If Else type thing?Since your lookup for if the name exists occurs after the append, it will *always* be true. The following doesn't do an if/then/else (which would be a great 4.0 addition, hint, hint ; ) but by storing the state of the first lookup in a text variable, you can test it later without it being effected by the append.[text]UserName_Caps=[uppercase][UserName_][/Uppercase][/text][text]UserName_Test=[Lookup db=BldrUsers.db&value=[UserName_Caps]&lookinfield=UserName&ReturnField=UserName&NotFound=][/text][ShowIf [UserName_Test]![UserName_Caps]][Append db=BldrUsers.db]UserName=[UserName_Caps]&PassWord=[PassWord_]&EmailAddr=[EmailAddr_][/Append]User Added[/ShowIf]
[ShowIf [UserName_Test]=[UserName_Caps]]This User Name Already Exists. Try Another![/ShowIf]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Rob Marquardt DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...