#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    31
    Rep Power
    2

    Display an alert message for 5 sec


    Helllo i want to display an alert message when i click the update button and after that to perform the update action
    Code:
     my $cFunction = qq{
        function timeout_trigger() {
            window.alert('Hello!');   
        }
        
        function timeout_init() {
            setTimeout('timeout_trigger()', 2000);
        }
        
        };
        
        print $q->script($cFunction);
        <--html form--->
        
            $cInput_form .= $q->image_button({-src =>  '/media/images/save_1.png',-class => 'upd',-title => 'update', -name =>'Update', -value => $row_id, -onclick => 'timeout_init()'});
            print $q->fieldset ({-class => "ui-widget ui-widget-content"}, $cInput_form);
    i think what i am doing is wrong because it doesnt make the message to dissapear after 5 sec, and doesnt't work. could somebody tell me another way?
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    As far as I know you can't automatically close an alert dialog. However, you could use a pop-over HTML element to display your message instead and show/hide it whenever you want.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo