Topic: Initialize input fields loaded with Ajax

Beedge pro asked 6 years ago


I have a form that is loaded into a tab via ajax.

If the form is pre-populated from the database the labels obscure the inputs

What it the correct way to trigger the labels? I have read that I need to add the 'active' class to the labels on fields that contain data. Is this the only way? or can I have some javascript call execute when tab is loaded?


Gustavo Ramón free commented 6 years ago

Same problem!!!

Mirosław Stasiak free answered 6 years ago


Hi, The easiest way is when you add the active class to the labels on fields that contain data. Regards,

Gustavo Ramón free commented 6 years ago

Solved! //input field receive value $("#input-field").val("value"); $("#input-field").trigger("focusin"); $("#input-field").trigger("blur");

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags