Open Closed

How to focus cursor on the first input field? #1676


User avatar
0
Shoba24 created
  • ABP Framework version: v4.3.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I have pop up modal that contains 5 tabs.Inside each 5 tabs having button to open another pop up modal.

In that pop up modal(new form),i want to focus cursor on first input field and in edit form want to focus cursor on end of the text of first field.


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to set the cursor in the event of the Modals.

    https://docs.abp.io/en/abp/latest/UI/AspNetCore/Modals#functions

  • User Avatar
    0
    Shoba24 created

    Hi,

    I tried to set cursor in the event of the modals like below but didn't work!!!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you create a project to reproduce?

    The project you sent me can't open the license modal in the Businesses modal.

    https://abp.io/get-started

  • User Avatar
    0
    Shoba24 created

    There is no license menu item in the side menu.We have only business and contact menu item under Business settings.Business -> when we click NEW BUSINESS -Tabs are disabled except business tab ,so we can't directly navigate to other tabs like contact,license,insurance,bank.Once if we fill all the fields in business and click next ...all other tabs are enabled,we can navigate directly. .

    In Edit business-All tabs are always enabled.You can test with edit business option

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    It works for me.

    licenseCreateModal.onOpen(function () {
        $('#License_LicenseNumber').focus();
    });
    

  • User Avatar
    0
    Shoba24 created

    Thanks, It works now!!!.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11