HighDots Forums  

Calling a function...

Javascript JavaScript language (comp.lang.javascript)


Discuss Calling a function... in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DSL
 
Posts: n/a

Default Calling a function... - 04-20-2004 , 12:19 PM






I'm pulling my little hair that's left out trying to figure out how I can
call a function from within a function. Here's the deal... and yes I know I
should be using PHP!

I have a password login screen for three users who have individual
pre-assigned passwords so i need some logic testing as per below


// ========START OF CODE=========

//This is the function to find out who is logging in
function validate()
{
//Change case from the input
var usrid=document.form.usrid.value.toLowerCase()

//Simple if statement for the who's logging in logic
if(usrid=="TEST") //**??THIS IS WHERE I HAVE PROBLEM 1 (FOR
SURE)??**
else
if(usrid=="") alert("ID REQUIRED!")
}

//This is the password check for the user TEST
function validateTESTIDPwd()
{
//Change case from the input
var pwd=document.form.pwd.value.toLowerCase()

//Validate password
if(pwd=="TEST") //**?? THIS IS WHERE I HAVE PROBLEM 2 (MAYBE)??**
else
alert("Password Incorrect!")
}

// ========END OF CODE=========

OK, so problem 1: How can I call the validateTESTIDPwd() function
and problem 2: After confirming the identity of user TEST I want to open up
a page in the current frame. Does anyone know how to manipulate my frames
from this point?

All help appreciated.

Cheers,

Matt



Reply With Quote
  #2  
Old   
Mick White
 
Posts: n/a

Default Re: Calling a function... - 04-20-2004 , 03:31 PM






DSL wrote:


function popup(txt){alert(txt)}
function validateTESTIDPwd(){
if(document.form.pwd.value.toLowerCase()=="test"){
popup("Password Correct");
return;
}
alert("Password Incorrect!")
}

Mick

Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.