Welcome Guest, Not a member yet? Register   Sign In
problems with ajax
#11

[eluser]pegas[/eluser]
I got a problem similar to this.
I have a textarea and a button that sends me to a javascript function.
The function gets the value of the textarea and codes it so not to mess up my url and then by prototype I go to my controller.

My javascript function :

Code:
function enregEx(index,params){
  var param = document.getElementById('excuseTxt'+index).value;
// alert(encodeURIComponent(param));
    var url='enregExcuse/'+params+'/'+encodeURIComponent(param);  
    new Ajax.Updater('excuseDiv'+index,url,{onLoading:function(request){cursor_wait();}, onComplete:function(request){cursor_clear();}, evalScripts:true}); return false;
}

I've tried escape() , encodeURI() and the method encodeURIComponent() but get that my request contains illegal characters all the time.

Any ideas ?




Theme © iAndrew 2016 - Forum software by © MyBB