Move to the end of a form field

  • Hi,

    I added a field with WPRichText.InputEditField('CAMPO','');

    When I open the form, I use WPRichText.MoveToNextField(True);

    So the first field is selected, but the cursor is on the beggining of the field, like <<|Rua >>, how do I move the cursor to the end of the field (<<Rua |>>), so I can continue typing after the default content?


    Thanks!

  • Zitat von wpsupport

    You can use CPMoveNext until you hit CPChar=#3 - that would be the field closing.

    Or you read the current field -FieldAtCP- and use TextCursor.MoveTo( field.EndTag )

    But I have many fields on the form, and I navigate throught them using tab, and every tab I want the cursor to be on the end of the field, because every field have some default value I will use or change as needed.

    Can you give a sample code on how to achieve that?

    Also my WPTools_6_Reference is not showing any content, it shows the index but not any content..I just moved to a new PC with windows10, what can I do?

    Thanks!

  • Ok I found a way to achieve that using

    WPRichText.TextCursor.MoveTo(WPRichText.FieldAtCP().EndTag);

    But I still can't figure out where to use this code to make it happen on every field change..

    I tried OnEditFieldFocus but it doesnt work.

    Also, I assumed that to move the cursor to the start of the field should be

    WPRichText.TextCursor.MoveTo(WPRichText.FieldAtCP().StartTag);

    but it doest do anything.