Discussion:
Get Select option value and send it to a python module! how ?
Prabhakaran Kasinathan
2013-09-27 16:13:00 UTC
Permalink
Hi everyone,

This question could be very simple, but I am new to this.


I have a test.xml where I have this following select option. I need to send
the selected value to a python module change_value

test.xml
..
..

<?python
data = ""
?>
..
.
<form method="POST" action="/change_value/$data/${tspec.id}">
Select the value #
<select id="channel" title="Select the channel">
<option value="11">11</option>
<option value="12">12</option>
</select>
<input type="submit" value="change_channel" />
</form>
Channel changed to: $data
--

<!-- I can use the java script attribute to access :
document.getElementById('channel').value);" /> , but i dont know how to
update $data value using javascript attribute.-->

But I need to send this value to the function change_value/$data ( where
this data should be updated ).. How do access the value from the select
option value and send that value to the any python function which is
written in controller.py. ?

This could be a very basic question, but i need some help. Thanks.
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/groups/opt_out.
Simon Cross
2013-09-27 16:28:01 UTC
Permalink
Hi!

You can't modify template variables from Javascript. Javascript only
has accessed to the rendered template which no longer has any
variables (the rendered template is just HTML).

Schiavo
Simon
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...