Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: instant status message


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Dec 22, 2015 6:51 AM Last Post By: Thomas Feichten...
Thomas Feichten...

Posts: 4
Registered: 1/20/10
instant status message  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2015 12:17 AM
Hi guys,

when I post my PHP-Form it takes a while till the server responses of course. So in some Browsers ist hard to see for users that their Button-Click was "accepted" and things are running.

So therefore I want simply change a Labels Caption to "please wait..." instantly before dealing the PHP-request. So the user gets a immediate recognizable "Response" on his click.

I tried a lot to implement it with the different onClicks in JS and PHP. But I did not find the correct order of PHP/JS code to achieve that.

Changing al Labels-Caption with JS works fine, Changing it with PHP works fine. Even Changing it with AJAX works in my tests.
But I couldn't manage to deal with that in correct order...

Any help/hint would be appreciated.

Thanks/Regards, Tom
Thomas Feichten...

Posts: 4
Registered: 1/20/10
Re: instant status message  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 22, 2015 6:51 AM   in response to: Thomas Feichten... in response to: Thomas Feichten...
Hey all,

I finally got it working this way...

function Reload()
    {
        $this->tbbedingungenplus1->Filter = "pid=".$this->Edit1->Text;
        $this->tbbedingungenplus1->refresh();
    }
 
    function Button1JSClick($sender, $params)
    {
    echo $sender->ajaxCall("Reload");
        ?>
        //begin js
            $("#Label1").html('loading...');
        //end
        <?php
        $this->Label1->Caption = 'ready';
    }


Does exactly what I wanted and looks to me like a good piece of handcrafted code ;-).

Regards, Tom

Thomas Feichtenschlager wrote:
Hi guys,

when I post my PHP-Form it takes a while till the server responses of course. So in some Browsers ist hard to see for users that their Button-Click was "accepted" and things are running.

So therefore I want simply change a Labels Caption to "please wait..." instantly before dealing the PHP-request. So the user gets a immediate recognizable "Response" on his click.

I tried a lot to implement it with the different onClicks in JS and PHP. But I did not find the correct order of PHP/JS code to achieve that.

Changing al Labels-Caption with JS works fine, Changing it with PHP works fine. Even Changing it with AJAX works in my tests.
But I couldn't manage to deal with that in correct order...

Any help/hint would be appreciated.

Thanks/Regards, Tom
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02