Library code snippets
Validating the form contents
This is once again an extremely important use of Javascript (this was one of the primary uses of Javascript). It reduces the time and resources on the server side for checking of online forms. Once again I have found many implementations of this script. This is one I find easy to understand.
<SCRIPT LANGUAGE = "JavaScript">
<!--
function isReady(recv_form) {
if (recv_form.feedback.value != "")
return true;
else {
alert("Please include a feedback message.");
recv_form.feedback.focus();
return false;
}
}
//-->
</SCRIPT>
<BODY>
<FORM NAME = "myform" onSubmit = "return isReady(this)" METHOD=POST ACTION
= "http://www.kiranpai.com/servlet1">
<TEXTAREA NAME = "feedback"></TEXTAREA><br>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</BODY>
Related articles
Related discussion
-
Alternative to javascript in those examples.... please help!!!
by James Crowley (5 replies)
-
Javascript and PDF Forms
by whippy (0 replies)
-
Compatibility Issue on Firefox to display on Cursor Location
by dinc3r (1 replies)
-
London Web Standards
by johnenderson (0 replies)
-
How to stop & start the scrolling text on mouseover & onmouseout event.
by codeunit (3 replies)
Related podcasts
-
Episode 6: Sizzling Open FX
I have moved to Mozilla along with my long time friend cohort and collaborator, Ben Galbraith. He joins us on this podcast, along with Alex, who joins us as a Noogler. You can download the podcast directly (OGG format too), or subscribe to the series, including via iTunes). We get back in...
Events coming up
-
Apr
8
jQuery - An Introduction
Edinburgh, United Kingdom
Abstract A new client-side framework has been taking the internet by storm, many have already been mesmerised by the power of such a small javascript library. And "what is the name of this fantastic framework?" I hear you ask, "jQuery" is my reply. jQuery is a robust javascript framework with a very small footprint (15kb minified and GZipped) which makes the complicated aspects of javascript very simple. From traversing the Document Object Model to complex AJAX functionality, jQuery can do i...
This thread is for discussions of Validating the form contents.