GIDForums  

Go Back   GIDForums > Computer Programming Forums > Miscellaneous Programming Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Nov-2007, 21:13
krystyna93 krystyna93 is offline
New Member
 
Join Date: Nov 2007
Posts: 6
krystyna93 is an unknown quantity at this point
Unhappy

Flowchart confusion


Hi there all c programmers,

i was hoping someone could help me out with developing a flowchart for the javascript code below...

its causing too much confusion for me, so i have enlisted the help from all you people who are probably more experienced than me

Your help will be greatly appreciated!

thank you Christina
-------------------------------------

Code:
function checkForm() { if (document.getElementById("name").value == "") { window.alert("Please enter your name"); document.getElementById("name").focus(); return false; } else if (document.getElementById("address").value == "") { window.alert("Please enter your address"); document.getElementById("address").focus(); return false; } else if (document.getElementById("phone").value == "") { window.alert("Please enter your telephone number"); document.getElementById("phone").focus(); return false; } if(document.getElementById("phone").value.search(/\d{4}\-\d{4}/)==-1) { alert("The phone number you entered is not valid.\r\n Please enter a phone number with the format xxxx-xxxx."); document.getElementById("phone").focus(); return false; } var min=9;//a variable of a minimum of 9 numbers if(document.getElementById("phone").value.length != min)/ { alert("The phone number you entered is not valid.\r\n Please enter a phone number with a maximum length of xxxx-xxxx."); document.getElementById("phone").focus(); return false; } else if (document.getElementById("suburb").value == "") { window.alert("Please enter your suburb area"); document.getElementById("suburb").focus(); return false; } else if (document.getElementById("postcode").value == "") { window.alert("Please enter your postcode"); document.getElementById("postcode").focus(); return false; } var postcode = new String("1234"); if (document.getElementById("postcode").value.length !=4) { alert("Your postcode must contain four numbers only!"); document.getElementById("postcode").focus(); return false; } var postcode = new String("1234"); if (isNaN(document.getElementById("postcode").value)) { alert ("Please enter only numbers!"); document.getElementById("postcode").focus(); return false; } else if (document.getElementById("email").value == "") { window.alert("Please enter your email address!"); document.getElementById("email").focus(); return false; } var email = document.getElementById("email"); //variables to remember the position of the "@" and "." symbols var atPos = email.value.indexOf("@"); var dotPos = email.value.indexOf("."); if (atPos == -1 || atPos == 0 ||dotPos == -1 || atPos <1 || dotPos - atPos <2 || email.value.length <3) { window.alert("Please enter a valid email address!"); document.getElementById("email").focus(); return false; } else if(document.getElementById("card").selectedIndex == 0) { alert("Please select your credit card"); document.getElementById("card").focus(); return false; } else if(document.getElementById("month").selectedIndex == 0) { alert("Please select the month of expiry"); document.getElementById("month").focus(); return false; } else if(document.getElementById("year").selectedIndex == 0) { alert("Please select the year of expiry"); document.getElementById("year").focus(); return false; } return true; }
Last edited by admin : 10-Nov-2007 at 21:56. Reason: Please insert your example codes between [CODE] and [/CODE] tags
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flowchart for a while loop;need help.. krystyna93 C Programming Language 2 04-Nov-2007 21:21
Flowchart Problem ashayah C Programming Language 1 15-Oct-2007 14:28
Recursion and the confusion that comes with it Elsydeon C++ Forum 1 05-Sep-2005 21:05
windows sockets confusion ubergeek C++ Forum 1 18-Jul-2005 20:44
Pointers-general confusion of pointer type. warny_maelstrom C Programming Language 3 11-Mar-2004 21:26

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:29.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.