The specified value "2018-12-01" does not conform to the required format, "yyyy-MM-dd".

Hey everyone, how would I use JS to set the DateField in the userdefinedforms module to the first day of the previous month?

what makes you think its JS? it could be a FirstOfLastMonth field with a default value, couldn’t it?

is there such a thing as a FirstOfLastMonth field?

yes, both sites are mine, but the old site is several years old

and I've never made a custom form field, especially for the UDF module

right, so you are thinking you must have done it in JS then

yeah, but I can't find where I did that, or if i did make a custom field, i can't find that either

I KNOW!!! That's what's so frustrating, it's my code, but I can't find the JS if it is JS, and i've sifted through all the other code and I don't have any custom fields nor have I modified any of the module core code

do you have cms access? is there anything you can see on the formfield itself?

That's all the field shows...

Files: Requires logging in to the Slack workspace to view/download
Screenshot.png (PNG)

i dont think ‘default to today’ is standard

so i think you’ve extended something somewhere

exactly correct, I did say it's several years old...and uses an old version of jQuery UI and their datepicker, not the built in HTML5 one

or if it is standard, you’ve overridden it to default to 1st of last month

I think I finally got a javascript that will work now

yeah - you’ve definitely extended it or modified it to some extent, thats not core

I'm sure you'll need a hidden field or something to hold that DataObject ID you want the data from

haven't done it in a while, but i believe you still use that

that could be a very great tutorial!!!!!! @unclecheese would be great for that!