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.

jquery.val returns empty value

See original GitHub issue

Chrome’s version is 53.0.2785.143

When I call input.val() in firefox I get the value, but that doesn’t well in Chrome. I tried the ‘hack’ of disable > get the value > and enable the mask, but that didn’t seemed to work, either.

The mask is a date one: $('#birthday').inputmask('dd/mm/yyyy',{ "placeholder": "dd/mm/aaaa" });

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RobinHerbotscommented, Oct 24, 2016

@urielasecas , @MehdiSaeedifar ,

The jsfiddle showed me the problem. type=“date”

Which is supported on chrome and not on ff (ff uses fallback => text) The inputmask does not mask when the native type=date implementaion is used, but was patching the value anyway which causes the empty value.

1reaction
urielasecascommented, Oct 17, 2016

Thankyou, Robbin. Here is a simplified example on jsfiddle that works in firefox but not in Chrome 53.0.2785.143: https://jsfiddle.net/3xa3ztkn/2/

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery val() returns empty string - Stack Overflow
returns an empty string. And this is the only field that has this problem. Calling val() for other fields returns correct values. Even...
Read more >
.val() | jQuery API Documentation
The .val() method is primarily used to get the values of form elements such as input , select and textarea . When called...
Read more >
val() returns empty string when non numeric text pasted into ...
.val() returns empty string when non numeric text pasted into input type="number". E.g. When I copy number with "-" symbols inside ...
Read more >
JQuery val() returns empty string - YouTube
jQuery : JQuery val () returns empty string [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] jQuery : JQuery val () ...
Read more >
Check whether an input text box is empty with JavaScript/jQuery
To check if the input text box is empty using jQuery, you can use the .val() method. It returns the value of a...
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