h..
Seems that I need to return js code lines (not js function) from
controller & get going ahead.
btw, I have found one line jquery code for selecting value of select
box.
"$('#element_id option[value=%s]').attr('selected', 'selected');" %
adict['key']
Thanks for your responses Anthony.
---
h..
Seems that I need to return js code from controller.
btw, I have found a one-line jquery code for this-->
"$('#element_id option[value=%s]').attr('selected', 'selected');" %
dict_obj['key']
This works & I will proceed with this, for time being.
Thanks for your responses Anthony.
--- Vine
I think you need .options[i] rather than .options(i). Anyway, it's
generally easier to do this kind of thing with jQuery rather than raw
Javascript.
Anthony
On Tuesday, November 8, 2011 9:04:41 AM UTC-5, Vineet wrote:
>
> Something is wrong in the function.
> I defined a test js function in Vi
I checked the js returned from controller function.
It is
selbx('edit_freq','daily');
selbx function is there in the View.
-- Vineet
On Nov 8, 7:04 pm, Vineet wrote:
> Something is wrong in the function.
> I defined a test js function in View.
>
> function alrt(mesg) {
> alert(mesg) };
>
>
Something is wrong in the function.
I defined a test js function in View.
function alrt(mesg) {
alert(mesg) };
And in Controller,
return "alrt('Hello World!');"
It works.
The actual js function is---
(it sees which value of select box matches the one returned from
controller; then sets the valu
On Tuesday, November 8, 2011 8:17:41 AM UTC-5, Vineet wrote:
>
> > If 'myvar' is a Python variable, you're going
>
> 'myvar' is a not a python variable.
> I pass the id of html element as argument.
> Javascript code sets the value of that html element.
OK, but same problem -- 'myvar1' isn't a
> Probably a typo, but missing the closing single quote (') after the }} for
> the URL.
It is a typo here. It is correct in actual code.
> If 'myvar' is a Python variable, you're going
'myvar' is a not a python variable.
I pass the id of html element as argument.
Javascript code sets the value o
On Tuesday, November 8, 2011 7:45:59 AM UTC-5, Vineet wrote:
>
> In a View, there is --> ajax('{{=URL("salhead_edit")}}, [],
> ':eval');
>
Probably a typo, but missing the closing single quote (') after the }} for
the URL.
> "salhead_edit" returns js function --> 'abc(myvar1)'
>
Unless 'm
8 matches
Mail list logo