Hi all -
Referencing Formatting Dates, it says:
// Get the date from the date field of the current item const date = $w(“#myDataset”).getCurrentItem().dateField; // Set the text element to display the date using the user’s settings $w(“#dateText”).text = date.toLocaleDateString()
So, I made the changes required:
(line 1) Changed $w(“myDataset”) to “Registrationpage”
On the same line, changed.getCurrentItem().dateField; to todaysdate (in which is the name of the datefield in registrationpage data collection
(line 2) Changed $w(“#dateText”).text to text3.text
Checked spelling, all formatting thingies, tried capitals, tried all non-caps.
Set permissions to read only then write only then read/write.
Set users to anyone, admin only, all combo’s
and I can’t get the date to show on the lighbox field “#text3”.text
Where be I go wrong? Help!
Sorry, forgot to add this
(Line with the dreaded red dot)
const date = $w(“#registrationpage”).getCurrentItem().todaysdate;
All other lines OK
Darn it, forgot to mention this: The red squiggly error line is under registrationpage and the error message says Not a valid selector.
@deleteduser
Thanks again. To quote the famous ancient philosopher Homer Simpson ‘DOH’. OK, that worked, no more red dots, the code is clean. Sadly, still no display on the text3.text box. This is a lightbox page with a 4 input fields (which work fine). At the top of the database (under the logo) is textbox3, which currenly says ‘TODAYS DATE’. When I made the correction and loaded the page … still no date display, just the oriiginal text TODAYS DATE that I put in.
This is a non-member page (anyone can visit it). I guess maybe I need some ideal permissions of some sort. Can you advise?
Not sure what I’m missing. Here’s a shot of the page