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.


Comments (0)| Print| Send | 1482 Views | 14% / 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 thislink.

Comments (0)| Print| Send | 522 Views | 5% / 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:

The base script (1.cfm):
value 1:
Value 2:
Value 3:

The code for _2.cfm:

The code for _3.cfm:

So, the current solution was to add to _1.cfm and onchange="document.frm.hfld2.value=this.value;return loadFragmentInToElement('_3.cfm?rnd=#RandRange(1,99999)#&fld1v=#fld1v#&fld2v='+this.value, 'spn2')" instead of onchange="return loadFragmentInToElement('_3.cfm?rnd=#RandRange(1,99999)#&fld1v=#fld1v#&fld2v='+this.value, 'spn2')" to _2.cfm .

If anyone have any clue about a real solution to this problem, please don't hesitate to comment on it.

Comments (0)| Print| Send | 312 Views | 3% / 0% Popularity