NetTalk Central

Author Topic: Field-level validation  (Read 4526 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Field-level validation
« on: May 16, 2011, 10:30:41 AM »
I needed to do a field-level validation. For this field I checked the "Send new value to server" on the Client-Side tab and added code to the Server Code. In there I did the check in code and set loc:altert and loc:invalid when the value was found to be invalid. However the error is correctly displayed BUT the focus is not set to the field in loc:invalid.

I found a similar problem in the web53 sample app - on the MailboxesFormControl procedure with the MAI:NickName field. It has the same behaviour - doesn't give focus to the field set in loc:invalid.

How could the user then otherwise be restricted to the field when invalid?

Thys

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Field-level validation
« Reply #1 on: May 16, 2011, 02:07:01 PM »
Thys,

I noticed the same, I think it has something to do in which the fieds are added to the template (ie the 1st field you load get the 1st validation, later you add something and 'move it up the list', well, that field has number #9 nevermind if it is 3rd on te screen.

I just ignored it, as it always force the required fields, but I agree, that would be a minor improvement which makes sense.

BB.

Cheers
Charl

PS. I add my 'extra' validation code to the Validate All Embed point, I think it's a bit of a pain of you know what to validate on the 'screen' and check it for every field when you can do all of it at the same time, unless you have hide/unhide fields.  Note my careful use of quotes (this web stuff is difficult to describe.)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Field-level validation
« Reply #2 on: May 19, 2011, 12:24:05 AM »
Maybe Bruce can answer this then - if the normal template code does not force the field to be selected, how can it be done in hand code?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Field-level validation
« Reply #3 on: May 19, 2011, 04:11:40 AM »
I'm looking into this.

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Field-level validation
« Reply #4 on: May 27, 2011, 01:59:34 AM »
Bruce, is there a possibility for this also to be fixed (or explained) in release 5.27?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Field-level validation
« Reply #5 on: May 29, 2011, 08:27:21 AM »
only seems to happen in IE.
but I've added a work around, so
it's fixed in 5.27

Bruce