tag:blogger.com,1999:blog-2807403883562053852.post7883072465610179740..comments2024-03-27T08:40:31.785-06:00Comments on Clayton Cramer.: An Interesting JavaScript Field Validation ProblemClayton Cramerhttp://www.blogger.com/profile/03258083387204776812noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2807403883562053852.post-58962828042039044702010-11-30T22:45:16.609-07:002010-11-30T22:45:16.609-07:00"You would not believe the mess I am trying t..."<i>You would not believe the mess I am trying to clean up.</i>"<br /><br />Oh yes we would. BTDT. Still doing it, in fact, to my disappointment.Kirk Parkerhttps://www.blogger.com/profile/05921711310191924997noreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-48919299112618251132010-11-30T18:13:30.577-07:002010-11-30T18:13:30.577-07:00A lot of the existing code has Submit buttons alwa...A lot of the existing code has Submit buttons always enabled. I'm fixing this as the opportunity presents itself. (You would not believe the mess I am trying to clean up.)<br /><br />Concerning the problem of no valid input: that isn't a problem with any of our fields. The worst that happens is that after they click OK, they can hit the Back or Cancel buttons on the screen.Clayton Cramerhttps://www.blogger.com/profile/03258083387204776812noreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-19667087573446514622010-11-30T09:36:02.788-07:002010-11-30T09:36:02.788-07:00"Do whatever checking you need to, then use a..."Do whatever checking you need to, then use alert() to warn the user that there is something wrong with the input, and set focus back to this."<br /><br />This is a bad idea. What happens when a user winds up in a field where, for whatever reason, there is no valid data that can be entered?<br /><br />Generally you should not do this. If you feel that field-level validation is critical, change the background color of the text box or something, but ALWAYS leave the user an out that isn't Alt-F4.<br /><br />(Yeah, I do UI work as a fairly significant part of my day job. Forcing users to quit an app because they can't get off a field enrages them.)Rick Chttps://www.blogger.com/profile/10992428161064901136noreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-78251971800006222842010-11-30T08:12:41.617-07:002010-11-30T08:12:41.617-07:00"You don't want to wait for the user to h..."You don't want to wait for the user to hit the Submit button before checking the values that he has entered."<br /><br />Don't make the submit button visible until after the values are checked.ErisGuyhttps://www.blogger.com/profile/09383064735664269791noreply@blogger.com