facebook

Form name in external JavaScript file generates warning

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #251299 Reply

    Curt King
    Participant

    I’ll be the first to admit that I don’t know Javascript.

    Here’s my dilemma: I’ve placed functions in an external JS file. Those functions refer to the FORM name in the HTML file. Example:

    HTML File

    <FORM method="POST" action="summary.jsp" name="choiceForm">
    .
    .
    .
    </FORM>

    JS File:

    function twoToOne() {
        var selectedlen = document.choiceForm.selected.length;
    .
    .
    .
    }

    In my “Problems” tab, I see a warning message:

    choiceForm declaration is not found

    How can I get rid of this message?

    Thanks,
    Curt

    #251327 Reply

    Riyad Kalla
    Member

    Curt,
    I believe this is the JS validator being overly pedantic assuming that it’s running on a full HTML page and not an individual file. I’ll ask a developer to look into this, but in the mean time, when you run this, does it work?

    Also you can disable this by turning off the javascript debugger in the project, but that will ignore other errors as well. We hope to provide more granularity over the validation errors moving forward.

    #251601 Reply

    Curt King
    Participant

    Yes, the code still works.

    I turned off JS validation for the time being.

    Thanks,
    Curt

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Form name in external JavaScript file generates warning

You must be logged in to post in the forum log in