Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form has no action when submit button is pressed

Posted on 1999-07-01
5
Medium Priority
?
153 Views
Last Modified: 2010-04-09
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 http://www.texnet.net/jill/test  Any advice will help.
0
Comment
Question by:jkljkl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:Xrusha
ID: 1851424
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.
0
 

Author Comment

by:jkljkl
ID: 1851425
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.  
0
 
LVL 9

Expert Comment

by:TTom
ID: 1851426
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.

Tom


0
 

Accepted Solution

by:
SteveHalko earned 400 total points
ID: 1851427
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)      {


0
 
LVL 8

Expert Comment

by:us111
ID: 1851428
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....


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question