Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2002, 07:43 PM
MarioPro's Avatar
MarioPro MarioPro is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Portugal
Posts: 53 MarioPro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 38 sec
Reputation Power: 7
Question Two forms validation on same file - help

Hi,

I'm having a problem with form validation with the script I'l post bellow. Thanks in dvance for any help.

I have one "Register" form and a "Login" form on the same page and when I try to login without entering any values, the alert bos shows the unfilled fields fo the "Register" form ?!

How may I validate each one separately using the following script (I use in double, one for each form):

<script language="JavaScript1.2" type="text/JavaScript1.2">
function validate(login) {
login=document.forms[0];
var msgStr="";
if(login.username.value=="") msgStr+="• No Username, \r\n";
if(login.password.value=="") msgStr+="• No Password, \r\n";
if(msgStr!="") {
msgStr=msgStr.substring(0,msgStr.lastIndexOf(","));
alert(msgStr);
return false;
} else {
return true;
}
}
</script>
__________________
-----------------------------------------------------------------------------
If a word can't save lives, silence may probably kill - Preventing suicide is your task to!...

Reply With Quote
  #2  
Old September 27th, 2002, 02:03 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
This is the wrong forum for this

Go post again in the HTML, Javascript & CSS forum.

Reply With Quote
  #3  
Old September 27th, 2002, 03:24 AM
MarioPro's Avatar
MarioPro MarioPro is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Portugal
Posts: 53 MarioPro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 38 sec
Reputation Power: 7
Hi,

Thanks for the post. It was a mistake

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Two forms validation on same file - help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway