On Sun, 8 Apr 2012 23:32:31 -0700 (PDT), [email protected] said:
> How to call the multiple function or set the multiple target via Ajax
In the view:
<form>
<input name="name" onkeyup="ajax('echo', ['name'], ':eval')" />
</form>
<h3>Start of target1</h3>
<div id="target1"></div>
<h3>End of target1</h3>
<h3>Start of target2</h3>
<div id="target2"></div>
<h3>End of target2</h3>
In the controller:
def echo():
return "jQuery('#target1').html(%s);jQuery('#target1').html(%s);" \
% (repr(request.vars.name.upper()),repr(request.vars.name.lower()))
When you type characters into the form, they will be inserted as uppercase
in target1 and lowercase in target2.
NB: I've not tested the code above, but the principle is sound; if it
doesn't work, let me know and I'll test and fix.
--
"You can have everything in life you want if you help enough other people
get what they want" - Zig Ziglar.
Who did you help today?