There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Javascript Problem


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
petetim's Avatar
Member with 34 posts.
 
Join Date: Nov 2004
Experience: Intermediate
24-Aug-2005, 01:01 PM #1
Javascript Problem
Hey guys,

A friend of mine is working on a form in javascript for a uni project and is having a bit of bother. She asked me to have a look and I couldnt see anything (not that great at it myself). Any suggestions why its not working would be appreciated.

Thanks


[B]else if (document.newmem.Email.value ! = “”)

{

isAtSign=False;

for(var i=0;i< (document.newmem.Email.length);i++)

{

if(document.newmem.Email.CharAt(i) = = “@”)

{

isAtSign = True;

}

}

if(isAtSign != True)

{

alert(“The Email Address you have entered is not valid- please try again”);

document.newmem.Email.focus();

valid=False;

}

} [/b]





newmem is the form name

Email is the text field name for the email to be inputed

The check is that somewhere in the email address there should be a "@" sign.
So it goes in if the email field is not empty, and isAtSign is a variable that is set to false to begin with

It goes in a loop, through all the chars in the email address and sees if it =@
And if it does it puts isAtSign =true

Then theres a check to see if IsAtSign is not true
And if its not then an alert message is thrown up

Valid =false is the thing that is returned later in the page so that the form is not submited
jiml8's Avatar
Senior Member with 1,514 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
24-Aug-2005, 02:09 PM #2
and the problem with it is...
petetim's Avatar
Member with 34 posts.
 
Join Date: Nov 2004
Experience: Intermediate
25-Aug-2005, 03:52 AM #3
Its not doing anything wrong in particular, its just not picking up a problem and going on to the next page.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:43 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.