Posted At : Apr 23, 2010 17:15 PM | Posted By : Ed Tabara
Related Categories: ColdFusion, AJAX, JavaScript, jQuery

Yesterday a had to create a script where some cells in a html table would change their values based on changed values on the server. So, all it took is to set the timer and at given period of times to call a server side script and gather the info and then display it in right places. Below is a simplified version of this script. It will call a server script each secod and display the value in a DIV. The first script is the one that you will load in the browser: Current Time is: <div align="center" id="clockID"></div><script src="js/jquery.js"></script><script language="JavaScript"> $(document).ready(function() { var refreshId = setInterval(function() { $('#clockID').load('clock.cfm?rnd='+ Math.random()); }, 1000); }); </script> And the server-side script is:#TimeFormat(Now(), "HH:mm:ss")#...

| 10024 Views | 12% / 0% Popularity


Posted At : Dec 04, 2009 14:04 PM | Posted By : Ed Tabara
Related Categories: ColdFusion, AJAX, JavaScript, jQuery

Given Have a form with 3 fields: Zip(text field), City(text field), State(dropdown field).Problem description The user fills in the Zip. Then, when starting to fill the City, AutoComplete appear (from those that have filled Zip). When/If one is selected the Stateis filled automatically. Solution Nowadays there are many solutions for AJAX AutoComplete but i choosed the jQuery plugin from devbridge.com. It seem to work very well and on the site are given details on how to use it. So after incuding the library with creating the form:Zip:? ?City:? ?State:? selected>selected>#stateName# and ading the JS: i started to test it in order to move farther. And of course issues started. First problem was that the value from the Zip field was not passed to index.cfm?action=buyers.getCity. Instead of the value just entered was passed the one that was in the field at the start, so it wasn't exactly what i needed. Maybe there exist an easier way, i don't know, but after quite long play...

| 6913 Views | 8% / 0% Popularity


Posted At : Jun 19, 2008 23:03 PM | Posted By : Ed Tabara
Related Categories: AJAX

Be aware of incorrect formatted HTML! Yesterday i was checking a script that was using AJAX to load some form fields into the form based on the selection in a drop down. Everything there was working fine except the fact that when submitting the form, all AJAX loaded fields was missing in the FORM structure. And this was happening in FireFox while working fine in Internet Explorer. To be short i will get right to the solution. The problem was that the FORM tag was right after the TABLE tag (read FORM inside TABLE). Right after i changed the order, all worked fine....

| 7622 Views | 9% / 0% Popularity


Posted At : May 03, 2007 6:14 AM | Posted By : Ed Tabara
Related Categories: ColdFusion, Other, AJAX

Not long ago was doing some AJAX code that would allow 3rd party sites load data from other site. Everything worked fine when having the "base site" and the "test sites" in same place, but when tryin to run that with 2 different domains.... no luck... Came out that "the browser security model does not allow using XMLHttpRequest (XHR) from one web page domain to contact an URL on another domain". Nice huh? To see more details on it, visit this link. ...

| 4841 Views | 6% / 0% Popularity


Posted At : Mar 31, 2007 15:26 PM | Posted By : Ed Tabara
Related Categories: ColdFusion, AJAX

Had an interesting issue this week with Safari and Opera. description: Have a form with 3 drop downs. First one have values, the second is populated based on the selected value in first select, the 3rd is populated with values based on the selection in the 2nd drop down. Problem: All work fine with IE and FF, but not in Safari and Opera. The actual population work fine, BUT right after the 3rd drop down is populated with values, the second drop down disappear at all. And as result, when the form is submitted, that field and it's value are not passed. Solution: I did not find yet a good/real solution for this issue, but just a workaround. What i've done, was to create a hidden form field that get populated with the selected value in the second drop down on the onchange action. To illustrate this better here is an emulated example: The JS code look like this: '; xmlhttp.open("GET", fragment_url); xmlhttp.onreadystatechange = function() { if (xm...

| 7615 Views | 9% / 0% Popularity