1
jilong
Possible to have popup alert on edituser.php?
  • 2007/7/10 1:54

  • jilong

  • Just popping in

  • Posts: 61

  • Since: 2007/1/10


I would like to get a user proper Real Name and Contact number (i have change AIM field to contact number), but i found some user had key in number in Real Name field and a word in Contact Number field, this is what i dont want.

I had add in the code below to make sure user fill in the Real Name and Contact number.

$name '';
        if (!empty(
$_POST['name'])) {
            
$name $myts->stripSlashesGPC(trim($_POST['name']));
        }
        if (
$name == '') {
            
$errors[] = _US_NEEDNAME;
        }
        
$user_aim '';
        if (!empty(
$_POST['user_aim'])) {
            
$user_aim $myts->stripSlashesGPC(trim($_POST['user_aim']));
        }
        if (
$user_aim == '') {
            
$errors[] = _US_NEEDCONTACT;
        }


but this is not enought the number still could save as Real Name and the wording still could save as Contact number.

Is there any ideal for use to insert the alert code something like below?

if ($name == '0-9'){
alert("Please fill out the proper name")
element.focus()
}

if (
$user_aim == 'a-z'){
alert("Please fill out the proper contact number")
element.focus()
}

2
jilong
Re: Possible to have popup alert on edituser.php?
  • 2007/7/10 9:24

  • jilong

  • Just popping in

  • Posts: 61

  • Since: 2007/1/10


i have try in few way, but also not work, it give me blank page.

if (parseInt($name) != $name){
    
$errors[] = _US_NEEDADDS;
}


if (
isNaN$name == ''){
    
$errors[] = _US_NEEDADDS;
}

3
jilong
Re: Possible to have popup alert on edituser.php?
  • 2007/7/15 17:55

  • jilong

  • Just popping in

  • Posts: 61

  • Since: 2007/1/10


still no ideal to have popup alert, but finally i get the way to check name and phone number to show up error message

if ($name == '' || !checkname($name)) {

if ($tel_hp == '' || !checkphone($tel_hp)) {

Login

Who's Online

291 user(s) are online (266 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits