Javascript working in Preview but not in New Form

This is likely a rookie question!

But I have all my functions working properly and in preview mode everything works well. However when I copy the link, or generate via Power Automate, my functions don't seem to work.

I have a function that autofills the province dropdown, and one that hides fields based on a condition. This does not seem to work for some reason.

Another thing to note is when I preview in tablet or phone view, they do not work in preview mode at all.

Any insight would help, thanks.

Hello @5by5,

Are you getting any values from URL parameters using JavaScript?

Could you please share the code and the link to the form. You can send the link to the form in a direct message

You are a trooper for responding to all of my posts!

So I was able to figure this out, it was a syntax error for me in the end. BUT, I do want to note that the preview was working even though I had a couple of syntax problems (yes I saved with the updates). For example I had a default dropdown that used '==' instead of '=' to set the drop down value. It showed this working in preview mode with the incorrect syntax, but then when sharing the link it did not work. After correcting this, both preview and the live form worked great. But this happened with a few different functions that had some similar little errors like that. So I don't know how preview was reflecting the changes.

Thanks again.

Hello @5by5,

Some data from the form is caching, so it is a good idea to clear the browser cache periodically while testing the form.