how to make dhtmlx Ajax call


#1

I am new to dhtmlx , I am trying to validate a text box for a user Id, I mean when a user enters an Id that should not used by any other user so on submit of form I am calling javascipt fun in that I am calling to a controller for that i have used following code,

<form class="well" id="create_teacher"  method="post"
action="<%=request.getContextPath()%>/controller/TeacherManagementController?flowName=CREATE_TEACHER_INFO" enctype="multipart/form-data" onsubmit="checkTeacherId()">

In javscript,

[code][/code]

and sendRequestPost is,

<script> function sendRequestPost(tId){ alert("alert2 "+tId); str="param2="+tId; dhtmlxAjax.post("<%=request.getContextPath()%>/controller/AjaxController" ,encodeURI(str),outputResponse); } </script>

and I used one more link to make Ajax call is,

So here I am checking flow by alert, the functions are working fine and in controller I have given brakepoints so my problem here is I am getting alert boxes but control is not flowing to the Controller class. Can any one help me in this.


#2

Your code is correct

dhtmlxAjax.post("<%=request.getContextPath()%>/controller/AjaxController" ,encodeURI(str),outputResponse);

This line makes post call of “/controller/AjaxController”
Please beware that is a normal POST call, same as form submit, it doesn’t have any ajax specific attribution.


#3

Then where I am wrong , control not even passing to Controller