I'm getting the form is not defined error when is useform.parentNode.appendChild(iframe);inside a javascript function, I don't know why.

Any suggestions?

Recommended Answers

All 3 Replies

if i understand your code you want to add iframe to an exsiting form. if that is so
than try this. if it work tell me
var useform = document.getElementById("your forms id");
before you can use the useform

Don't think the OP is adding an iframe element to the form, but adding it to the form's parent element. But your suggestion is valid that using getElementById() function to obtain the element from the DOM.

Anyway, back to the OP... Do you have a form tag name "form"?

@ i get you Taywin. i thing his function is not working becasue of the form. you must refreen you form tag's name. that is (form tag's name).parentNode.appendChild(iframe)
i am right @ Taywin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.