Reply to topic
Form validation using ASP
eriweb


Joined: 06 Apr 2004
Posts: 68
Reply with quote
Hey everyone,

I was looking for some resources on ways to validate forms against blank inputs, and one such that if a user selects a radio box then force them to also input something in a text box ( for example if they select choice other from a list of radio boxes then they would be required to put in a text field what the other is). I am trying to do this using ASP and am looking at displaying the error on the site rather than like the javascript way where the error message is displayed in a dialog box.

Also, lets say a selection is made from a dropdown box and based on that selection if I wanted to display other fields that relate to that field ( for example from a drop down box I select a person's first name, based on that I want to display that person's last name, age and so on), and all this info would be pulled from a database.

Any help in this would appreciated, thanks.
Josh
Forum Regular

Joined: 01 Apr 2004
Posts: 1031
Location: Felton, Delaware
Reply with quote
Using traditional ASP you're only true choice - for speed - is using Javascript routines. If you have ASP.NET you have server declared client side script blocks that are EASY to implement. But with ASP you're way out on a limb.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
javascript...that's going to be the way to go - you don't have to display it in a box. You can use Javascript to hide divs so that it appears to pop up on the page and do all sorts of cool stuff.

and you kow...even in ASP.NET - most of the client side validation is Javascript anyways...I was suprised but it's true...there's other stuff tossed in there too sure, but for all intents and purposes, the client side validation is still just javascript.
Josh
Forum Regular

Joined: 01 Apr 2004
Posts: 1031
Location: Felton, Delaware
Reply with quote
Yep... thats what I was telling them in my last post. ASP.NET makes it easy... you don't need to know javascript. You just apply the validator control and set it for the actions you want to occur, and maybe a summary control, and WHAM you've got validation. It doesn't get ANY nicer than that Smile

I used to have a txt file chock full of JS validation stuff... I'll have to see if I can dig that up for you...
eriweb


Joined: 06 Apr 2004
Posts: 68
Reply with quote
Thanks guys, and Josh if you can find that JS file that would be helpfull. Again thaks for your help.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
Just google for "javascript page validation" and you should find a whole lot of stuff I would imagine.
DatabaseDude


Joined: 04 Mar 2005
Posts: 67
Location: Elkins, WV
Reply with quote
Two sites I can recommend for having a plethora of helpful Javascript, validation and otherwise:

http://www.javascript.com
http://javascript.internet.com

Actually I just wanted to be able to say I used the word "plethora" before noon on a Monday when I hadn't yet had my daily allotment of coffee Smile But hope this helps.

Bryant
eriweb


Joined: 06 Apr 2004
Posts: 68
Reply with quote
Thanks everyone for your input.
Form validation using ASP
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic