NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on June 25, 2016, 06:37:11 AM

Title: After completing field set focus to another field
Post by: terryd on June 25, 2016, 06:37:11 AM
I have a form where The user selects a drop down on FIL:field1.
Once this dropdown is selected I unhide FIL:field2.
I want to set focus to that unhidden FIL:field2
In  FIL:field1 on the drop tab there is a field 'When accepted, set focus'
What do I need to enter in this field to set focus to FIL:field2?
I have tried FIL:field2 but the cursor jumps to the first field in the form
Title: Re: After completing field set focus to another field
Post by: Bruce on June 26, 2016, 11:55:59 PM
Did you try
'FIL:field2'
including the quotes?
Title: Re: After completing field set focus to another field
Post by: Vinnie on June 27, 2016, 02:35:54 AM
Hi Terry.

I found that I had to change the position of this line.

p_web.SetValue('SelectField',Clip(loc:formname) & '.' 7 p_web.NoColon('NAMEOFYOUEQUATE'))

I moved this line between

!  [Priority 5000]

p_web.SetValue('SelectField',Clip(loc:formname) & '.' 7 p_web.NoColon('NAMEOFYOUEQUATE'))

! End of "After Validate New Value, After sending replies"

This  has been working great for some time so not sure if this has been fixed by now.
Cheers

Vinnie
Title: Re: After completing field set focus to another field
Post by: terryd on June 27, 2016, 06:33:11 AM
Thanks for the replies
Vinnie. I haven't tried your solution yet. I need to see if I can use the default system first.
Hi Bruce. Yes I should have enclosed in quotes  since the prompt did not state no quotes.
However
I have 3 places where I have done this
1. A checkbox where the field is unhidden.Focus is on the correct lookup button on the specified entry field
2. A drop list with no lookup but with extra possibilities. Focus is placed on the specified entry field
3. A string with a lookup. Here the focus remains on the string entry field, and not on the specified focus field. 
Title: Re: After completing field set focus to another field
Post by: Bruce on June 30, 2016, 06:38:03 AM
I'd need to see examples Terry.

Cheers
Bruce
Title: Re: After completing field set focus to another field
Post by: markster on June 30, 2016, 12:12:30 PM
Vinnie's solution (note: the 7 in his text should be an &) worked great for me. Placing that code AFTER the refresh call to display the hidden field that I wanted the focus set to was the answer.

Regards,

Mark
Title: Re: After completing field set focus to another field
Post by: terryd on July 01, 2016, 02:03:30 AM
Hi Bruce
Using Accounts Example(31)
I added 'INV:Paid' to INV:Customer field set focus in the UpdateInvoices Netwebform
compiled
Select Operations\Invoices
Change Invoice1
Select to change customer
Select Country South Africa from drop down
select Eco-Times systems as new customer
Focus still goes to Date not Paid checkbox
Attached App and Dct

Hi Vinnie and Markster thanks.
I checked the location of that line in the code from the attached App and it is already in  Priority 5000 after End of Validate New Value
  If loc:noFocus = false
    p_web.SetValue('SelectField',clip(loc:formname) & '.' & p_web.NoColon('INV:Paid'))
  End
Moving the line slightly lower to
  ! Start of "After Validate New Value, After sending replies"
  ! [Priority 5000]
 p_web.SetValue('SelectField',clip(loc:formname) & '.' & p_web.NoColon('INV:Paid'))
  ! End of "After Validate New Value, After sending replies"
without the noFocus check had no effect, focus still set to Date field