How to display date from database in "text input" with a type=date?

I have bind the text input with a Dynamic Attribute value of the date data coming from the database but on my form update the value that I bind with date data coming from my query somehow did not get pass back to the database if no change was made for date field. Instead it override the database date field with 0000-00-00 instead of keeping the same data that was currently queried and by right should have just got updated with the same data that was queried.

I am trying this database update using a Node.js project and I am currently using Wappler version 3.9.9

here is what i am working with as an example.

<input class="form-control" id="inpt_dates" name="dates" aria-describedby="input1" data-rule-date="" type="date" dmx-bind:value="content.modaledit.data_detailadlist.data.dates">

Thanks in advance if any of you can tell me why when a text input type is set to date is does not want display the dmx-bind:value or maybe I am missing something here.

@Teodor @mebeingken @psweb

Where are you pulling the value from there was some pathing issues that I believe was fixed in the betas not sure if this problem existed in 3.9.9

Thanks for your reply @ @Sorry_Duh cool username by the way. I am pulling the data from a mysql database. the value is coming from a repeat region tie to a data detail to populate the form. Well If this is a bug I guess I am gonna have to wait until Wappler 4.0.2 come out even tho I am currently on 3.9.9 I usually like to wait 2 updates before I update Wappler.

If you have time can you try it out and see is happening on your end?

I havenā€™t actually used a date field yet was just suggesting this might be a path issue as I know there was a few areas what had them fixed recently you could editing the value not entirely sure what it would be in your case if it is incorrect maybe

depending on structure or even

thatā€™s if this is the issue maybe something else entirely.

If youā€™re using a repeat that has a value called ā€˜datesā€™ you wonā€™t be able to have an input called ā€˜datesā€™ too. Try changing the SC Post value to something like new_dates and then update any queries that use it and make the input you put the code for above as name="new_dates"

Thanks for your reply @bpj actually the repeat those not have a value called dates I just edit ā€œnameā€ here when I post the message for simplicity.

Do you see the correct date in the field before submitting the form?

I did, I bind it to a regular text input and a paragraph element just to see if the correct data was returning I even try date format and even try convert to date under the input with type=ā€œdateā€ it still wouldnā€™t pass back to the database without overriding to 0000-00-00

When you submit the form, what do you see in the developer tools of the browser as POST values for the form?

Sorry I talked too quick. the value the did not populate in the field it was only the showing the date picker

Iā€™m confused, did it show in the text input/paragraph to check the binding?

When the form summit the POST value was blank.

image

It did but not for the input with a type of date.

image

Is that it as a text input? If so, itā€™s not a valid date. Dates need to be in yyyy-MM-dd format for MySQL

No that is not the what I am sending back those are regular text input that I was testing to make sure data was coming back the part circle in image is actually taking correct formatted date that is already coming from the database. This is a update step not a insert so that problem would have presented it self already if that was the case.

image

OK. Can you post the code for the form and a screenshot of the App Structure to show where the data detail is in relation to the form and the repeat youā€™re using?

Did you try the 2 values is sent above or did neither of them work?

I believe at this point there is a missed communication. The update form and data details are working correctly. the form that I am updating has other fields to it that are been updated ok when I submit the form. there is just this one singular element, the input value with a type of date and currently has a dmx-bind:value that is suppose to update back with the already data that is bind to it if no changes was made to that field.

Literally tried everything been trying for a month now lol

Have you tried making it a text input and then changing it to a date-picker?