1

I am trying to utilise the GuidedTours component within my custom component so that I can provide my users with some direct online help. So I'm having some problems with the target field so that the help modal box jumps to another tab on the record. ie main default tab has title and description, then next tab is introduction (fieldset = introtxt, field = intro_text) with editor field for lots of text. The modal appears no problems at all, but focus is still on the main default tab so I'm not able to enter any details. Any clues as to how to set focus on next tab would be greatly appreciated.

1 Answer 1

2

Found it. I needed to enter a step to click on the tab heading to direct the focus over to the new tab. So in my situation the target for this intermediary step was

target=button[aria-controls=introtxt]

So just for completeness, my array of steps looks like this

    $recs[] = array(
          'title'=>'Add a Title',
          'desc'=>'<p>Enter a required title for the new entry.</p>',
          'position'=>'bottom',
          'target'=>'#jform_title',
          'type'=>2,
          'intertype'=>2,
          'url'=>''
          );
    $recs[] = array(
          'title'=>'Move to Introductory Tab',
          'desc'=>'<p>Click on the tab Introduction</p>',
          'position'=>'bottom',
          'target'=>'button[aria-controls=introtxt]',
          'type'=>2,
          'intertype'=>4,
          'url'=>''
          );
    $recs[] = array(
          'title'=>'Introductory Text',
          'desc'=>'<p>Enter an outline introduction of the record.</p>',
          'position'=>'bottom',
          'target'=>'#jform_intro_text',
          'type'=>2,
          'intertype'=>2,
          'url'=>''
          );

Hope this helps others.

2
  • Thank you for taking the time to provide your answer.
    – Irata
    Commented Dec 18, 2023 at 22:46
  • Thank Irata, just working on other field types now so I'll be posting another question if I can't work it out. Cheers. Commented Dec 19, 2023 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.