I received a comment in my other article with the same title from Larry C. Lyons indicating me a better solution by Stuart Langridge making use of a Javascript library he wrote called sorttable.js, which sorts the HTML table by sortable headers, without having to send another request to the database.
Very well done, congratulations Stuart.
Archive for category Javascript
How To Grey-Out the Screen
Dec 12
This is an article very interesting for those who want to apply the effects of LightBox to your alert windows. I found this article on a post by Patrick Hunlock where he says:
This snippet “grays” out the screen and allows you to create a “modal” environment. A gray out is useful for creating a DHTML dialog box, or showing off a picture or video.
Here is the link.
Sometimes in an Intranet you need to notify the client that his session is about to expire and let him to decide if he will renew his session or let it die. That can be done either on server or client side.
We will discuss here the client-side way using Javascript and/or Ajax to refresh the session.
The script offers two ways of refreshing the session, one by just reloading the page and other by calling an Ajax function.
If your template is a form, you will want definitively to use Ajax, or you would lose all the fields already filled in. If you are in a simple display page, refreshing that page will not cause any problems.
So, I used a sample my friend Pedro Claudio posted on the CF-Brasil mailing group, and modified it to be used in CF templates with CFAJAX components (not the CF8 tag). I also modified it to use the Javascript function “setInterval()” instead of the “settimeout()” which will continue counting the time after every renewal.
I created this test environment that you may download here.
Read the rest of this entry »
My friend Flavio asked me for a code to select some options from a select box and populate other that will be submitted with the form as the “chosen” options. I know that there are many forms to do that and there are on the web several tutorials using Javascript and extensions as jQuery, etc.
I wrote a simple javascript with ideas from what I have seen on the web and it came out working good. So the credits are not all mine.
Download the code here









