0
have a
<input type="date" class="form-control" name="data">
In Jquery I need to capture this date and then send it to BD
var data = $("#data").val();
But the value only returns 'Undefined'. How do I get the value of an input type date?
0
have a
<input type="date" class="form-control" name="data">
In Jquery I need to capture this date and then send it to BD
var data = $("#data").val();
But the value only returns 'Undefined'. How do I get the value of an input type date?
2
When searching for a non-existent id it returns Undefined. Add the id attribute with its name.
<input type="date" class="form-control" name="data" id="data">
You can search for elements by name with:
$("input[name='nome do input']").val()
#
is used to specify the desired element is the most specific selector.
.
Serves to specify one or more elements using a certain style class.
Browser other questions tagged javascript jquery ajax
You are not signed in. Login or sign up in order to post.
The
name
generally serves for the back-end for the front-end add the attributeid
– rray
With @rray mentioned, the id is missing. No
jquery
the selector with#
serves to find in element by id, adds aid='data'
in hisinput
that will work– Ricardo Pontual
Afff... of course... thank you
– Rafael Christófano