Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

My form is not valadating

Posted on 2011-02-20
4
Medium Priority
?
366 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 83

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 83

Accepted Solution

by:
leakim971 earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

783 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