Topic: How to use input fields with jQuery

dagiri free asked 6 years ago


Hello, I am a beginner for MDB. I tried to use input fields with jQuery. I have a problem for input. I don’t understand how to move label.   Assuming there are two inputs, one is form1, and the other is form2. I would like to change form2, when the form1 is changed. Then I wrote like,   $("#form2).chage(function() { $("#form1").val("NewData"); }   The “New Data” shows on the input. However, the label doesn’t move. The image is like below. If I click the input field, the label moves. What function should I call, after I set data? Thank you for your kind support.   Regards,

Jakub Strebeyko staff answered 6 years ago


Hi there dagiri, Thanks for reaching out. You are correct - the move of labels is dependent on them gaining and losing the .active class. If you have any more questions, don't hesitate to ask. With Best Regards, Kuba

dagiri free commented 6 years ago

Hi Kuba, Thank you for your kindness. I appreciate your help. I wrote codes for all label to be made active. I wonder there is a method to make all labels active at once, because after loading from server, labels become active without writing any codes. Should I have to write scripts to make each label to active? There are several labels in the window. Thank you again for your kindness. Best Regards, dagiri

dagiri free answered 6 years ago


It seems that I should use  [ class = "active"  ] in the label tag. If someone else has more information, please support this. Thank you in advance. Regards,

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Specification of the issue

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