t1m0n / air-datepicker

Lightweight, dependency-free JavaScript datepicker.
https://air-datepicker.com
MIT License
2.64k stars 1.37k forks source link

Datepicker not populating value field #264

Open sabrinaazad opened 6 years ago

sabrinaazad commented 6 years ago

Hey, my datepicker works fine. But I notice this is not filling the value field once a date is selected/updated. The value field is null. How can I change this? I see in my console the value field is not updating.

t1m0n commented 6 years ago

Hi! Could you please provide an example of your problem on https://jsfiddle.net/ ? As I understand that after selecting date in calendar, input's value doesn't change?

MyZik commented 6 years ago

@t1m0n have a similar problem https://jsfiddle.net/MyZik/3j2j7xe2/5/

t1m0n commented 6 years ago

@MyZik you are using wrong id attribute in your example. Should use id='datepicker' instead of id='#datepicker1'. Here's what it could look like https://jsfiddle.net/3j2j7xe2/48/

petrosit commented 6 years ago

I have the same issue. What's the resolution here?

t1m0n commented 6 years ago

@petrosit what exactly issue do you have? Provide an example please.

petrosit commented 6 years ago

@t1m0n I set the value field to my predefined date and upon load, it is being removed from the text field and it's empty. I've now found a workaround by using the placeholder field...

so e.g. -> the value is being removed on page load

RenatAkhatayev commented 5 years ago

<input id="u_birthday" class="form-control datepicker-here" autocomplete="off" name="u_birthday" value="01/01/2000">

$('#u_birthday').datepicker({ language: config.language, firstDay: 1, dateFormat: "dd/mm/yyyy", autoClose: true });

При инициализации календаря, содержание поля удаляется

michal-poplawski commented 9 months ago

@t1m0n Hello, I'm struggling to submit value from air-datepicker. Everything works fine, like selecting dates and showing correct one in input field, but it doesn't fill value of input, which leads to the value not being sent through the form.

Can you please show basic form example how to submit date from air-datepicker? Seems like we need to do some 'hacks' for that.