...

View Full Version : help me make empty value,...



batubatamerah
11-19-2010, 01:44 PM
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


<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????
:o:o

angst
11-19-2010, 02:07 PM
this isn't a php question, it's a javascript question, and you didn't even post the javascript that your asking about...??

batubatamerah
11-19-2010, 02:29 PM
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..



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(elem, helperMsg){
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..

<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...

angst
11-19-2010, 02:32 PM
change this line:

if(isEmpty(password,password.value))

to this

if(isEmpty(password.value))



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum