Forum Moderators: open

Message Too Old, No Replies

Referencing form object in external js

Why can't I reference a form object in NN 4.7?

         

AWildman

2:53 pm on Dec 1, 2003 (gmt 0)

10+ Year Member



So sorry if this has been asked before, and I'm sure it has but I googled and searched here and found nothing. Is there some reason why I can't reference a form object in an external js file in NN 4.7? My code works fine if I have the javascript on the page with the form, but I don't want to do that. I don't want to have to touch more than one file when I want to change my js. Am I missing something completely obvious, like everyone in the world knows that you can't use code in an external js to reference a form object with NN?

AWildman

2:57 pm on Dec 1, 2003 (gmt 0)

10+ Year Member



Never mind. I'm an idiot. It was within a nested div. *sigh*
I hate NN 4.x. to double dog dare inifinity.

<added>Now I have a new question. The form elements are in a table inside of a nested div. When I move the <form> and </form> tags to just inside the body, then my form elements turn into text! What gives?</added>

DrDoc

4:10 pm on Dec 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can we just say -- NN4 is buggy? :)

AWildman

4:23 pm on Dec 1, 2003 (gmt 0)

10+ Year Member



:) We can and I often do. Actually, I'm usually a lot harsher. I'll assume that it has to be within the innermost nested div of whereever the form elements lie, correct? I finally got my reference to form objects in the external js (a first!) and did so without having to have the opening and closing tags right outside the body.

I'm glad I figured it out toute suite cause I was going to get unhappy pretty soon.

DrDoc

4:27 pm on Dec 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it's even buggy enough not to be consistent. Yes, in this case I believe putting the form elements within the parent is sufficient enough. But there are other times when it may not be :)