Overall, this question is about applying some webflow classes to an embedded form in webflow. Currently I just wanted to test if I could get elements inside my form by tag name. I started with a simple test, just getting all my h2 tags in my form. I also added an h2 into webflow for comparison.
The following code works as expected (the h2 tags all say “cat”) for the h2 inside webflow, but has no effect on the h2’s inside my embedded form. When I open the console and expand my element list the h2’s in my form appear, but the debugger includes a message that says “value below was evaluated just now.” This makes me think that my code can’t see the h2’s in my form because they haven’t been built yet, but I put this code just before the body tag and also inside a webflow ready wrapper. Any ideas on what to do?
After doing some research I don’t think this is possible. I think because it violates the same origin policy (Same-origin policy - Wikipedia). Anyway, I think that I can’t access anything in my embedded form via javascript because it comes form Cognito forms rather than webflow.
If I’m wrong I’d be more than happy to be corrected as my route around this would be to hardcode the css tags and therefore lose all the power of webflow style classes.
Thanks! I was actually just looking at that documentation. I tried passing in my own style sheet but it wouldn’t let me because it was cross platform. Currently I’m trying to pass in the webflow url stylesheet, but I’ll need accessibility to style it with tags to access all the elements in the form. But I don’t think I can edit the webflow style sheet directly. Any other ideas?