NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: ralonso2001 on November 29, 2014, 08:06:25 AM

Title: Set Focus for the a particular field in a webform
Post by: ralonso2001 on November 29, 2014, 08:06:25 AM
Hi, I´m trying to set the focus on a control in a web form when it opens, but I cant make it work, it always strarts with focus on the first field but not the one I have set.
Where is the correct embed point to set the focus to a control?
Is "p_web.SetValue('SelectField',clip(loc:formname) & '.fieldname') the correct sentence?
Thank you!
Title: Re: Set Focus for the a particular field in a webform
Post by: Bruce on December 01, 2014, 05:48:19 AM
Hi Rodrigo,

>> Is p_web.SetValue('SelectField',clip(loc:formname) & '.fieldname') the correct sentence?

yes. But be aware that the .FieldName part is case sensitive.

The problem is _when_ you do it, because the form "procedure" is an Event Handler, not a procedure.
I would probably do it in the preInsert or preUpdate routine, but I would use differnet code;

loc:retrying = true
p_web.SetValue('retryfield','fieldname')


Cheers
Bruce
Title: Re: Set Focus for the a particular field in a webform
Post by: ralonso2001 on December 01, 2014, 08:17:36 AM
Thank you Bruce!
When I place the code in the "PreInsert" embed point, it opens the form and gives me all the validation warnings of the required fields, I seems than when I put the value of true in the loc:retrying variable it performs validations in the form fields.
Any help will be great!!! My customer seems not to understand that this functionallity is not so symple...