Solved

My form is not valadating

Posted on 2011-02-20
4
337 Views
Last Modified: 2012-05-11
I am trying to validate my form for some reason i just cant get it right form.html view.js
0
Comment
Question by:imagekrazy
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 34939915
chaneg the name of yoru submit button (for example Submit or mysubmit but not submit) :
<input id="saveForm" class="button_text" type="submit" name="mysubmit" value="Submit" />

Open in new window

0
 

Author Comment

by:imagekrazy
ID: 34940014
that didn't work
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 34940286
>i just cant get it right
>that didn't work

could you give more information about what you need and how you test it ?

Else return true if everything is alright :

else {
				return true;
			}

Open in new window


function applyOnSubmitToForms()
{
	elementsForms = document.getElementsByTagName("form"); 
	for (var intCounter = 0; intCounter < elementsForms.length; intCounter++) 
	{ 
		elementsForms[intCounter].onsubmit = function ()
		{
			if (!validateForms())
			{
				alert("please fill");
				return false;
			}
			else {
				return true;
			}
		}
	} 
}

Open in new window

0
 

Author Comment

by:imagekrazy
ID: 34943018
almost  there, now I added what you told me to, and it's kinda working,  When i preview it my my browser and if i fill out the form completely, its now telling me to fill  everything,  even when i filled out everything?
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Newbie CSS questions 4 27
aligning image inside table cell 4 27
text align center the options is an html select 4 28
SVG Logo 4 20
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now