473,473 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I validate an online form?

9 New Member
Hello,

I am trying to validate a form using dreamweaver cs3. I am doing so using behaviors, however I do not have the option to validate "onSubmit"? I am very new to web design, however I have used this option before.

Can anyone tell me why this option is missing and if I can get it back?s

Also, can I validate lists, and menus within my form using behavoirs?
Jan 18 '11 #1
1 1381
Bharat383
93 New Member
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function valid()
  3. {
  4.  if(document.getElementById("firstname").value == "")
  5.    {
  6.          alert("First Name is empty  !!!");
  7.         return false;
  8.     }
  9.   if(document.getElementById("mobile").value == "")
  10.     {
  11.        alert("Enter Mobile Number !!!!");
  12.        return false;
  13.      }
  14. }
  15. </script>
  16.  
  17. <form name="form1" onSubmit = "return valid()">
  18. First Name :: <input type="text" id="firstname" name="firstname" value="">
  19. <br>
  20. Mobile :: <input type="text" id="mobile" name="mobile" value="">
  21. <br>
  22. <input type="submit" name="submit" value="Submit"> 
  23. </form>
  24.  
Bharat Parmar(Bharat383)
Apr 21 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Les | last post by:
I've just started working with ASP 5 days ago, so go easy on me. My company needs an online form that user's can enter information into and once submitted, will dump the user-supplied info into a...
1
by: Techy | last post by:
I have two fields in my form so called : invoice and cash Now I want to validate this form on the client side with the help of javascript in such a way that if one of these fields is empy an...
2
by: kewi | last post by:
Hi, Does anybody knows how to create a time stamp in HTML on an online form and how can I send this online form to myself and another email filled in by a third person? Thank you for your help.
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
2
by: Neo Geshel | last post by:
Greetings, I have a form with a telephone field. It is very specific, as it has four text boxes - the country code, area code, prefix and suffix. I can validate each of them individually, but...
2
by: GarthRodgers | last post by:
Hey all I'm designing an online exam booking system in Access and need to find a way to import table data into Roboform (or some other form filling package) straight from the database. The only...
1
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i...
1
by: Man4ish | last post by:
Hi , I am trying to submit the online form and want to get the data after submission.How can i do it. I have heard it is possible using Lwp. But i am not sure. Manish
5
by: ghjk | last post by:
I have a web site with several web pages. They are having different number of variables. eg: first page having 4 variables in the form(Name, Phone, ID, Gender) second page having 10 variables in the...
1
by: Marcia Samantha | last post by:
Please help, I can't validate the Date of Birth and Preferred Insurance Field The JAVASCRIPT: <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.