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

x
?
Solved

My form is not valadating

Posted on 2011-02-20
4
Medium Priority
?
360 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
[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
  • 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 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

715 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