Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    help me make empty value,...

    hey guys,.. i'm newbie in php and need some help!!

    i wanna make update profile that will change previous data,.. i use javascript to check user input..
    here the php code
    PHP Code:
    <form action='edit_profil_member_verifikasi.php' onsubmit='return edit_profil_member()' method='post'>
                            <h3>Password Baru : <input type="password" name="newpass" id="newpass" value="" size="53" maxlength="30" title="Kolom ini tidak boleh kosong"></h3><br/>
                            
                            <h3>Confirm Password Baru : <input type="password" name="cnewpass" id="cnewpass" value="" size="44" maxlength="30" title="Kolom ini tidak boleh kosong"></h3><br/>
                            
                            <h3>Password Lama : <input type="password" name="passlama" id="passlama" value="" size="53" maxlength="30" title="Kolom ini tidak boleh kosong"></h3><br/>
                            
                            
                            <h3>E-mail Address : <input type="txt" name="email" id="email" value="<?echo $result['Email']?>" size="54" maxlength="30"title="Kolom ini tidak boleh kosong"></h3><br/>
    the problem is,.. eventhough i set the value of the PASSWORD BARU field empty,.. my javascript code that catch that variabel not empty,.. and in display PASSWORD BARU field always contain some dot marks not empty,..
    can anyone give me suggest to make this field empty????

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    this isn't a php question, it's a javascript question, and you didn't even post the javascript that your asking about...??

  • #3
    New to the CF scene
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by angst View Post
    this isn't a php question, it's a javascript question, and you didn't even post the javascript that your asking about...??
    sorry my mistake,.. here the javascript code..

    PHP Code:
    function edit_profil_member()
    {
        var 
    password document.getElementById('newpass');
        var 
    cpass document.getElementById('cnewpass');
        var 
    pass document.getElementById('passlama');
        var 
    email document.getElementById('email');
        
    if(
    isEmpty(password,password.value))
            {
                return 
    true;
            }
        return 
    false;
    }

    function 
    isEmpty(elemhelperMsg){
        if(
    elem.value.length != 0){
            
    alert(helperMsg);
            
    elem.focus(); // set the focus to this input
            
    return false;
        }
        return 
    true;

    the script just to check the password baru field empty or not,.. but it always return false eventhough i set this field empty..
    PHP Code:
    <h3>Password Baru : <input type="password" name="newpass" id="newpass" value="" size="53" maxlength="30" title="Kolom ini tidak boleh kosong"></h3><br/> 
    in web browser it seems like there some dot mark on that field...

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    change this line:

    if(isEmpty(password,password.value))

    to this

    if(isEmpty(password.value))

  • Users who have thanked angst for this post:

    batubatamerah (11-19-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •