IT Community - Software Programming, Web Development and Technical Support

How do I validate the form input before sending it to the server?

This is a discussion on How do I validate the form input before sending it to the server? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all..... How do I validate the form input before sending it to the server? Thanks & Regards itbarota..........


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-13-2007, 02:05 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default How do I validate the form input before sending it to the server?

Hi all.....

How do I validate the form input before sending it to the server?

Thanks & Regards
itbarota.......
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-13-2007, 02:57 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: How do I validate the form input before sending it to the server?

Hi all...

This example used the following code:

<script language="JavaScript">
<!--
function isValid() {
var email=document.form1.t1.value;
if (email.indexOf(' ')==-1
&& 0<email.indexOf('@')
&& email.indexOf('@')+1 < email.length
) return true;
else alert ('Invalid email address!')
return false;
}
//-->
</script>

<form name=form1
method=post
action="javascript:alert('The form is submitted.')"
onSubmit="return isValid()">
Your email:
<input type=text name=t1 size=20 >
<input type=submit value=Submit>
</form>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to attach file when sending a mail via flash form? aramesh Flash Actionscript Programming 1 03-07-2008 01:55 AM
Can I save space in my form by getting more than one input value from just one text f GDevakii HTML, CSS and Javascript Coding Techniques 1 10-26-2007 07:21 AM
Sending SMS through ASP.Net S.Vinothkumar ASP and ASP.NET Programming 12 09-17-2007 05:29 AM
Can I save space in my form by getting more than one input value from just one text f itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 02:48 AM
Append string from form input into existing file Archimedees PHP Programming 2 09-05-2007 01:23 AM


All times are GMT -7. The time now is 11:27 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0