NetTalk Central

Author Topic: How do I set the curson on a field on a form when it opens?  (Read 2762 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
How do I set the curson on a field on a form when it opens?
« on: March 18, 2010, 04:06:07 PM »
I want to conditionally set the cursor to a particular field on a form if the form is an Insert or a Update when the form updates.

I found this on the web but not sure if it works or how to convert to add to my app

<body onLoad="document.forms[0].fieldname.focus();">

Is there any other way to set on NTW5?

Cheers,

Kev

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: How do I set the curson on a field on a form when it opens?
« Reply #1 on: March 19, 2010, 08:27:31 AM »
in nettalk4 there is an embed "AfterSettingSelectField"

and add your own code

 p_web.SetValue('SelectField',clip(loc:formname) & '.PD:yourField')     !

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: How do I set the curson on a field on a form when it opens?
« Reply #2 on: March 19, 2010, 05:36:17 PM »
Thanks Poul that worked a treat.
« Last Edit: March 19, 2010, 06:32:11 PM by kevin plummer »

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: How do I set the curson on a field on a form when it opens?
« Reply #3 on: March 27, 2010, 12:59:31 AM »
Any way to get it to to start in a field on a specific row in a EIP Browse embedded on a form?

Cheers,

Kevin

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: How do I set the curson on a field on a form when it opens?
« Reply #4 on: March 29, 2010, 09:16:27 AM »
i have not used EIP much, but i guess its the same as getting a browse correct - make sure your target row is first - has been my normal approach.

i suppose its possible - i would start by looking at what happens when you return to a browse from an update - a bunch of values know the way.

its either easy or one of those things that bruce calls 'non-trivial'
if you find the easy way, i'd be interested.


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: How do I set the curson on a field on a form when it opens?
« Reply #5 on: March 29, 2010, 05:52:51 PM »
Good idea - I will try to add a lookup from the browse and see what happens.

Kev