Solved

My form is not valadating

Posted on 2011-02-20
4
341 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

770 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