[SOLVED] Get data from HTML Element

@julienallard1
Thank you… Yes it is working fine… Now on change of input value , the function is getting trigerred, and getting latest value.


In below screnshot i have bubble function which returns “text” for Start time . So

So storing it in custom state of type text.

Next I want to achieve is , I have one more html component with input type=“time”
where i want to show session start time + 1 hour. And if user changes it manually then calculate accordingly.


So what i was trying to convert that text to Date using Expression and then perform equations.

But some how this expression plugin is giving different errors. right now i got this below error.
The plugin Toolbox / element Expression threw the following error: ReferenceError: date is not defined
at eval (eval at (PLUGIN_1488796042609x768734193128308700/Toolbox-update–Expression-.js), :1:1)
at eval (PLUGIN_1488796042609x768734193128308700/Toolbox-update–Expression-.js:3:66) (please report this to the plugin author)

So can you guide me with this how to read valur of one element and perform actions on that.

Can we just one line of code to convert this text to date format while calling the function?

Hey @julienallard1
Wish you a very happy new year.
Well, i’m still stuck with this issue that how to read those html eleemnt values and convert them in date or time. As I want to perform actions on those values and set it to another date & time input element.
I tried with Expression element, but it is giving an error.
Can you please guide me with this?

In javascript, statements are case sensitive, meaning that new date() is not the same as new Date(). To generate a date object you need a capital D. That’s why you get the message that date is not defined.

@julienallard1
I’m using the same expression new Date()
but when expression elements load for the first time,it is giving below error.

The plugin Toolbox / element Expression threw the following error: ReferenceError: date is not defined
at eval (eval at (PLUGIN_1488796042609x768734193128308700/Toolbox-update–Expression-.js), :1:1)
at eval (PLUGIN_1488796042609x768734193128308700/Toolbox-update–Expression-.js:3:66) (please report this to the plugin author)

@julienallard1
expected a date but got a object. Expression threw the error.

well in the screenshot you provided, date() is not capitalized

441b8c04f1656b7b4c75356d75a535745c64bd0b_2_690x383

Hi there,
How did you created that HTML element code? an online tool? or manually ? Webflow?

can you write a script example on how you did it, i asked chatgpt to code it but i still struggle on how to implement it