Forums
This topic is locked
How 2 show error page 2user when Column cnt b null
Posted 30 Mar 2007 12:17:10
1
has voted
30 Mar 2007 12:17:10 Minesh Dattani posted:
Hello everyone,I've got a Record Insertion Form, and some of the fields are set as "NOT NULL". When I miss out a few fields, the browser shows the text - Column 'propertytype' cannot be null, which is fine, as it cannot be null. But how do I redirect this to a user friendly page which basically says, "sorry you havent written in all the fields, please go back". How do I do this in dreamweaver?
Thank You
Replies
Replied 30 Mar 2007 18:01:37
30 Mar 2007 18:01:37 Alan C replied:
I have had the same thing, that error message comes from the database so it is not easy to get rid of, you might consider doing some checking in one of two ways
either
add some javascript to the page, so that when the user clicks submit the javascript checks that there are at least characters in the approperiate fields, you can make this as sophisticated as you like, personally I am not good with it, so I search around and find checks that are something like I want and modify them.
or
add some php that does the checking before you try to write to the database, then you can re-populate the form with the good fields and highlight the bad fields. A great way to highlight them is to have different CSS classes then all you have to do is change the class and the field gets hightlighted.
either
add some javascript to the page, so that when the user clicks submit the javascript checks that there are at least characters in the approperiate fields, you can make this as sophisticated as you like, personally I am not good with it, so I search around and find checks that are something like I want and modify them.
or
add some php that does the checking before you try to write to the database, then you can re-populate the form with the good fields and highlight the bad fields. A great way to highlight them is to have different CSS classes then all you have to do is change the class and the field gets hightlighted.