Form has no action when submit button is pressed

The form that I am working on has a call to a Javascript function when I press the Submit button.  My problem is that the function does nothing once it has been called.  I wrote code for a messagebox at the beginning of the function to make sure it is being called and it worked, but the other aspects of the function do not work.  The form is located at  Any advice will help.
Who is Participating?
SteveHalkoConnect With a Mentor Commented:
You have a misplaced close curly bracket } in function VerifyMe().

Move the last } about 8 lines up (put it right before the line that says:
if (msg.length>0)      {

Your page doesn't work as a form, as it must be. Button work on alert only. You have to create <form action> command to make your form work. JavaScript is good thing to use on client side, but in your case form is important.
jkljklAuthor Commented:
I have a form action command.  It is <form method="POST" action="results.asp">  When the Javascript function is called it goes through field validationa and then submits the form.  
I think you are causing confusion and asking for trouble by not naming your form and using the name in your function.  
You might sort this out by using alerts to display some of the information you are looking for, e.g.

alert(form) which, according to your script (I think) should display document.form(0).elements.  BTW, I don't think the syntax is correct.  I think it must be document.forms[0].elements and it represents an array of all the elements in the form.  If you want the to loop through all the elements in your form, I think the loop code should be:

for (i=1; i < document.forms[0].length; i++)

Also, you are probably better advised to evaluate your verification function as either 'true' or 'false' and use
<form action='results.asp' onsubmit='return validate()'> rather than <input type=submit onclick='validate()'>

Lots to work on here.


Your form seems to be complex :)

Use Netscape , test your form
and then type javascript:
in the location bar. You will see your errors
line 91....

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.