Can you use the browser developer tools to confirm that the ajax request is going out properly, and that the proper value is returned?
On Wednesday, November 2, 2011 11:19:09 AM UTC-4, Vineet wrote: > > You are right. > To clear any ambiguity, I did this --> > > return "$('#i2').val('Vineet');" > > But still, no success. > > Any other hint? > > ---Vineet > > > On Nov 2, 8:15 pm, Anthony <abas...@gmail.com> wrote: > > On Wednesday, November 2, 2011 10:49:04 AM UTC-4, Vineet wrote: > > > > > thanks for replying. > > > I tried this--> > > > [Controller] > > > def lod(): > > > x = 'This is a val' > > > return "$('#i2').val(x);" > > > > Note, the returned value is simply a string from the perspective of the > > lod() function, so 'x' in that string is literally just the letter 'x' > -- > > it is not replaced with the value of your x variable. Also, you need to > put > > the value in .val() in quotes. You want: > > > > return "$('#i2').val('%s');" % x > > > > That will put the actual value of x inside quotes inside .val(). > > > > Anthony