![]() |
| Form validation using ASP |
|
eriweb
|
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
|
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
![]()
|
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
|
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
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
|
Thanks guys, and Josh if you can find that JS file that would be helpfull. Again thaks for your help.
|
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
Just google for "javascript page validation" and you should find a whole lot of stuff I would imagine.
|
||||||||||||
|
|
|||||||||||||
|
DatabaseDude
|
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 Bryant |
||||||||||||
|
|
|||||||||||||
|
eriweb
|
Thanks everyone for your input.
|
||||||||||||
|
|
|||||||||||||
| Form validation using ASP |
|
||
|



