CodeIgniter Forums
Problem with strings return from xajax.getFormValues() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with strings return from xajax.getFormValues() (/showthread.php?tid=15609)



Problem with strings return from xajax.getFormValues() - El Forum - 02-10-2009

[eluser]Berserk[/eluser]
Hi there, i'm using XAJAX for my project (xajax is lastest version and CI 1.6) . But currently i get <![CDATA[ before each string return by xajax.getFormValues(). What's this problem ?

my xajax function at Controller:


Code:
function updateUserStatus($form_data)
    {
        if($this->access->logged_in())
        {    
        $objResponse = new xajaxResponse();
        $status = strip_tags(trim(($form_data['headline_content'])));
        $objResponse->Assign("statusDisplay", "innerHTML", $status);
        return $objResponse;
        }
    }

and View :


Code:
<div class="block-border">    
<div id="statusDisplay"></div>
&lt;form id="form_status" name="form_status" method="post"&gt;
    &lt;input id="headline_content" name="headline_content" size="30" maxlength="30"&gt;
    <button type="button" id="btn_submit">Submit</button>
&lt;/form&gt;
</div>

Returned String is :
Code:
&lt;?xml version="1.0" encoding="utf-8" ?&gt;<xjx><cmd cmd="as" id="statusDisplay" prop="innerHTML"><![CDATA
[S[b]&lt;![CDATA[[/b]Bla bla bla Bla bla bla]]></cmd></xjx>

Any suggest ? Thanks.


Problem with strings return from xajax.getFormValues() - El Forum - 08-22-2009

[eluser]Unknown[/eluser]
I know the solution, but I'm not sure if this solution could cause other problems.

Here the solution:
Look at xajax_core.js file. Find script like this :
Code:
data='&lt;![CDATA['+data+']]>';return data;}
approximately on the line 48.
Delete or block script
Code:
data='&lt;![CDATA['+data+']]>';
So that becomes like this
Code:
//data='&lt;![CDATA['+data+']]>';
return data;}

This solution work to me..

Nb: I'm not sure if this solution could cause other problems.


Sorry about my English is less good.


Problem with strings return from xajax.getFormValues() - El Forum - 08-24-2009

[eluser]Berserk[/eluser]
thanks KL, currently i decided jQuery for my project, it's easier and faster than xajax Big Grin