Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / October 2004



Tip: Looking for answers? Try searching our database.

form validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dwd1 - 08 Oct 2004 20:29 GMT
i have been using coldfusion for a while and whenever i use form validation i
generally use CFFORM and CFInput tags and set required=true and message=message
to display in alert.

this works but what i would like to do is instead of an alert window with the
error message, reload the form, populated with the entered data and have a Red
star or something next to the feild that caused the error and diaplay an error
message at the top of the page, like "you need to enter a valid birthdate" or
something.

now i know that i could do this by having my form handler page have the logic
to validate the feilds and then include or do a cflocation to the original form
- but the trick is populating the form.  in the past i have had code that
creates new hidden form elements from the submitted form values and then uses
those values to populate the feilds but thats a pain to do, isnt there a
simpler way to use this style of validation?
kaasu - 08 Oct 2004 20:58 GMT
You can take a look at qForms for this kind of scenario.  Otherwise on your
form validation page if there are any errors,  put the existing form data in
some persistanct scope like session and then do a cflocate. In this way you can
repopulate your form fields if there are any error. Hope it helps
Lossed - 09 Oct 2004 05:39 GMT
here's one way:

in the validation, make an error list and shoot that back to the form to
help highlight the fields:

http://webmonkey.wired.com/webmonkey/99/17/index1a_page5.html?tw=programming

>i have been using coldfusion for a while and whenever i use form validation
>i
[quoted text clipped - 21 lines]
> those values to populate the feilds but thats a pain to do, isnt there a
> simpler way to use this style of validation?
Lossed - 31 Oct 2004 23:34 GMT
I just wanna update my suggestion by saying I now think it much better to do
what the kaasu says and stuff it in a session variable :-)
> here's one way:
>
[quoted text clipped - 28 lines]
>> those values to populate the feilds but thats a pain to do, isnt there a
>> simpler way to use this style of validation?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.