This time the error's on me

An essential skill in life is the ability to laugh at yourself and to try not to take anything too seriously. This I find myself doing increasingly often. Only yesterday I found myself stood next to Karen, in a health spa, booking herself a facial-cleansing treatment/massage. Before I knew what I was doing I had asked the female receptionist "Do you do men?" and found myself booked in this afternoon for the full monty. Don't tell anyone will you!

Then I had to laugh at myself again this morning. Turns out the reason I couldn't get yesterday's server-side validation to correctly set the SaveOptions field was because I'd named it $SaveOptions by mistake.

So, the server-side validation is possible with some simple @Functions in the WebQuerySave event. As soon as I've got this month's out of the way I'll try and make this approach fool-proof and write it up as June's article. Thanks for all the feedback yesterday. Should come in handy when I get round to making the real thing.

There's a rudimentary example form here. You're welcome to try and break it...


    • avatar
    • Sandra Borges
    • Wed 26 May 2004 05:40 AM

    Sorry, I just broke it... :-P

    • avatar
    • Jake
    • Wed 26 May 2004 05:50 AM

    Woops. I forgot to test for " " entries in name. Fixed now. This isn't really what I meant by breaking it though. Forget what values are required and in what format, it's the principle of server-side validation that I want to test. There's no real way round it AFAIK.

    • avatar
    • Anon
    • Wed 26 May 2004 05:51 AM

    Maybe its just me, but "Do you do men?" in a massage parlour could mean something completly different!!!

    On the other hand, there is a program on Sky1 on Sunday that may interest you:

    "How Gay Are You?

    Sunday 30, 22:00, Sky One

    Tongue-in-cheek series which asks heterosexual men - as well as their girlfriends or wives - questions about their pastimes and lifestyles to try to find out just how in touch they are with their gay side. "

    Not that I'm suggesting anything!

    • avatar
    • Aden
    • Wed 26 May 2004 06:03 AM

    A facial-cleansing massage....

    Its official men are the new women...

    • avatar
    • Jake
    • Wed 26 May 2004 06:05 AM

    I've seen the trailer for that program. Is there not a man having a facial and the words with the line of the song being "Face cream is just gayness in a jar"? You see, you have to laugh. I mean I have manly hobbies too. Like taking photos of flowers: {Link}

    • avatar
    • Woah! I'm going to Ibiza!
    • Wed 26 May 2004 06:07 AM

    Going on holiday and the Mrs suggested I get spray-tan before we leave. I'll be standing in a paper thong later today whilst some bird laughs at my A4-white arse.

  1. Well I didn't break it exactly, but you might want to put a maximum age in the age field or even calculate it from a ligitimate dob field?

    If you hadn't had cucumber on your eyes you'd have spotted the $SaveOptions field 8)

    • avatar
    • Sourav
    • Wed 26 May 2004 09:15 AM

    Check your example...

    Validations around age and country code is not proper.. not expected from Jake Howlett !!!

    • avatar
    • Jake
    • Wed 26 May 2004 09:29 AM

    Thanks Sourav. I trim the country field as well now. As I said, it's rudimentary at this point. Whether or not the *actual* validation works or not is not the point really. What I am trying to prove is that you can do it server-side and, once it works properly, can't be UN-designed by a user with some JS know-how.

    • avatar
    • Pam
    • Wed 26 May 2004 10:28 AM

    Lets home Karen doesn't see your blog, otherwise your in trouble.. ;-)

    • avatar
    • Jake
    • Wed 26 May 2004 10:41 AM

    Why Pam? She was there. When I say "full monty" I'm not talking about anything rude.

    • avatar
    • Jon
    • Wed 26 May 2004 10:42 AM

    The age field will ignore text after a number but will accept the entry. For example, i entered my age as "2 long" which was accepted. I'm not sure this could be considered as breaking it, but fyi.

    • avatar
    • Jake
    • Wed 26 May 2004 11:22 AM

    Thanks Jon. Fixed that now. The age field is text and the validation simply checked @If(@IsError(@TextToNumber(Age));...

    What this didn't do was any Input Translation. As well as the validation I needed to add @TextToNumber to the translation. Otherwise it just remains as the text you entered. @TextToNubmer doesn't return an error with things like "3 is the magic number 3". Instead it simply returns 3.

    • avatar
    • Doug
    • Wed 26 May 2004 11:24 AM

    From reading the comments, it appears that you (Jake) have set the standards too high. :-)

    You mentioned that this was a "rudimentary" example, but we are still questioning your validations.

    Looking at that, all I can say is.... Jake, keep up the great work!

    • avatar
    • David Schmidt
    • Fri 28 May 2004 08:17 AM

    Well I didn't break it, but I managed to put the validation form out of business, by entering |SCRIPT|document.forms[0].style.display='none'|/SCRIPT|


    • avatar
    • Jake
    • Fri 28 May 2004 08:24 AM

    Yeah, thanks David. I wanted you to test it, not hack it ;o)

Your Comments


About This Page

Written by Jake Howlett on Wed 26 May 2004

Share This Page

# ( ) '


The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social

About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content