question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Function to update field labels

See original GitHub issue

Hi guys,

I have a proposal and I do think, I’m not the only one who has this kind of issue. When I update empty text field with a value, for example via Angular, the label does not slide up.

14007e6e557bd08c7ced0d8d3c472990

I have read some stuff about how angular binds events and I know it’s almost impossible to catch the action nad hook it up. But if there would be a global method, lets say updateLabels([form]), which would go thru the document or given form/element and updates all the labels to be above the fields, that would be great.

Or is there a simple solution how to write such functionality by myself?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Dogfalocommented, Mar 9, 2015

added in e36d13c3ac2342b7992c596058bb717e8c2a5919 Materialize.updateTextFields()

1reaction
Dogfalocommented, Mar 3, 2015

@grafa This is already done in our forms.js

var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
 $(document).ready(function() {
      $(input_selector).each(function(index, element) {
        if($(element).val().length > 0) {
          $(this).siblings('label, i').addClass('active');
        }
      });
    });
Read more comments on GitHub >

github_iconTop Results From Across the Web

"Update field" post function for field "Labels" in a team ... - Jira
In a team-managed project, when using a post function to update the field "Label" for transitioning between statuses, it overwrites the existing ...
Read more >
Change field labels - WordPress Plugins
Click the pencil icon next to a field label to edit it. ... Make sure you hit “Update Form” to save all of...
Read more >
Solved: Update label of a field - ServiceNow Community
Solved: Hi All, I have a custom field on Incident form - Test ... function onChange(control, oldValue, newValue, isLoading, isTemplate) {.
Read more >
label field formula doesn't update when input field change
the label field only refresh sum when I patch the data after making changes and it refreshes a gallery. Any idea if i...
Read more >
Add_filter to change labels and descriptions of fields
<?php add_filter( 'forminator_field_text_field_label', function( $value ){ if( 'text-1' === $field['element_id'] ) { $ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found