Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Ajax Can i write JavaScript code in AjaxResponse Code ?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ramesh Naidu
Can i write JavaScript code in AjaxResponse Code ?
0 Answer(s)      3 years and 2 months ago
Posted in : Ajax


Hai Every Dynamic's 

We can't write JavaScript code in Ajax Response Code.Why because it takes only html,json,xml response.I tried a lot to create js form in ajax response.It's not working.rather than that i try to created on innerHtml document.

here:sName is the id of the particular text box...

var s="";
   s=s+"<form method='post' name='updateForm'><table border='1'><tr><td>StudentName</td><td>StudentAge</td><td>StudentDept</td></tr><tr><td><input type='text' name='v1' id='v1' value='"+document.getElementById('sName'+r).value+"'></td><td><input type='text' name='v2'  id='v2' value="+document.getElementById('sAge'+r).value+" onKeyup='isInteger(this.value)'></td><td><input type='text' name='v3' id='v3'  value='"+document.getElementById('sDept'+r).value+"'></td></tr><tr><td colspan=1>modify details</td><td><input type='button' value='Save' onclick='doValidate()'></td><td><input type='button' value='Cancle' onClick='clearMe()'></td></table></form><div name='str' id='str' style ='width:22em;border:1px black solid;padding-left:2px;padding-right:2px; visibility: hidden'></div>";

>   
> **document.getElementById("str").innerHTML=s;**

Advertisement
View Answers

Related Tutorials/Questions & Answers:
 

 

 

DMCA.com