473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to join many functions into one function

17
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function validateForm() {
  3.     var firstname = document.getElementById("text1").value;   
  4.     var surname    = document.getElementById("text2").value;
  5.     var email      = document.getElementById("text3").value;
  6.     var cellnumber = document.getElementById("text4").value;
  7.     var address    = documnet.getElementById("text5").value;
  8.     var cardnumber = document.getElementById("text6").value;
  9.     var date       = document.getElementById("text7").value;
  10.     }
  11.  
  12.    if (firstname == "") {
  13.     alert("Name must be filled out");
  14.     return false;}    
  15.  
  16.     if (surname == "") {
  17.     alert("Surname must be filled out");
  18.     return false; }
  19.  
  20.     if (isNaN(cellnumber)){  
  21.     alert("Enter Numeric value only");  
  22.     return false;  
  23.     }else{  
  24.     return true;  
  25.      } 
  26.  
  27.      if (isNaN(cardnumber)){  
  28.    alert("Enter Numeric value only");  
  29.    return false;    
  30.     }else{  
  31.    return true;  
  32.    }       
  33.  
  34.   {   
  35.    var atposition=x.indexOf("@");  
  36.    var dotposition=x.lastIndexOf(".");  
  37.    if (atposition<1 || dotposition<atposition+2 || dotposition+2>=x.length){  
  38.     alert("Please enter a valid e-mail address \n atpostion:"+atposition+"\n dotposition:"+dotposition);  
  39.   return false;  
  40.   }  
  41.  
  42.  
  43. </script>
Sep 6 '19 #1
1 1253
gits
5,390 Expert Mod 4TB
please explain your issue in a way that a reader can follow it and tell what the posted code has to do with it.
Sep 6 '19 #2

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

Similar topics

10
by: Sandman | last post by:
I have a master-script that runs for every site I make, and it has a standard set of functions, but sometimes I would want to override that function for a particular site, but if I redefine it for...
7
by: Nolan Martin | last post by:
is a static functions address constant? ie.. static void func(); write_to_file(&func); Restart program... static void func(); void (*funcPtr) ();
7
by: BlueDragon | last post by:
The place where I work is moving to MS SQL Server from Lotus Notes. I have done a lot of coding in Lotus Notes, and have, I suppose, intermediate skills in basic SQL -- queries, insert, updates,...
6
by: wyhang | last post by:
I want a implementation just like the "join" in the unix shell, I googled the web and found nothing. Any suggestion will be highly appreciated, thank you~
19
by: Gary Kahrau | last post by:
I want to create a function and can only get half way to my goal. dim sStr as string sStr = Entry(2,"a,b,c,d") ' Sets sStr = "b" Entry(2,sStr) = "B" ' Sets sStr = "a,B,c,d"...
0
by: Bruno Lavoie | last post by:
Hello, i'm etablishing a naming convention for a new project under postgresql. For tables, sequences, views, that's ok! I used good naming conventions for this in the past and i'll keep these...
1
by: CES | last post by:
All, I was wondering if someone could point me to a tutorial on creating & accessing functions from within a wrapper function. I've created a group of functions related to a timer event. All...
7
by: Petr Jakes | last post by:
I have got names of functions stored in the file. For the simplicity expect one row only with two function names: printFoo, printFOO In my code I would like to define functions and then to read...
4
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
18
by: NoWhereMan | last post by:
Maybe a stupid question. ------------------------- 1 ------------------------- $str = ''; for($i=0; $i<10; $i++) $str .= $i;
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.