I have a question about your suggestion.
Would it not be easier to simply carry the sessionid from the php session
validation to the javascript?
Instead of: if(document.frmlogin.txtusername.value=="")
                {
                        alert("Please Enter Username.");
                        document.frmlogin.txtusername.focus();
                        return false;

Why would I want to "re-enter the user name"?
My common sense "which maybe completely wrong" say, YOU ARE VALIDATED IN
PHPBB via issetid, now post to (document.frmlogin.userid.value=="")

This is why I am not catching your angle.

PhP makes so much more sense. This javascript integration is really giving
me a headache!

Suggestions?

Brad




-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 09, 2007 2:16 AM
To: Brad Sumrall
Cc: php-general@lists.php.net
Subject: Re: [PHP] PhP and Java login trouble

Brad Sumrall wrote:
> I have been hunting all around that website you referred me too looking
for
> javascripting information and can find nothing. I know a little bit of php
> but little to nothing about javascripting.

Eh? I never sent you to a website.

See this code:

        function validatelogin()
        {
                if(document.frmlogin.txtusername.value=="")
                {
                        alert("Please Enter Username.");
                        document.frmlogin.txtusername.focus();
                        return false;
                }
                if(document.frmlogin.txtpwd.value=="")
                {
                        alert("Please Enter Password.");
                        document.frmlogin.txtpwd.focus();
                        return false;
                }
                document.frmlogin.login.value="Success";
                document.frmlogin.action="operation.php?mode=login";
                return true;
        }


You need to create a *similar* function (eg 'BBValidateLogin()') to 
check different html field names.


For example:

function BBValidateLogin()
{
   var f = document.forms[0];
   alert('username is ' + f.username.value);
}

The username.value comes from this:

<input type="text" class="post"
name="username" size="25" maxlength="40" value="" />

where you have name="username"

So take the name="..." and put a .value on the end.

Rinse, repeat until you have checked all of the fields you need to.

Return true for the form to submit.

Return false for it to NOT submit.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to