Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Validation: Set Focus same field

Avatar

Level 2

Using FormCalc, I am trying to validate a field on exit, but want to set the focus to the same field until the user fixes the error.

I know I can use the statement $host.setFocus("ObjectName") , but can I call the object as a this (current object) instead of entering the name of the object explicitly?

2 Replies

Avatar

Level 10

this is not a part of FormCalc ...it is only valid in javascript. The $ is a replacement for this. Note that the parameter that you pass in is a SomExpression so you shoudl use $.somExpression

Paul

Avatar

Level 2

Tried this and worked.

$host.setFocus ($.name)


Thanks.