Question about how I'm passing a stack from js to python.
Posted: Sun Apr 03, 2011 6:27 pm
Server side (python):
edit: can't use code box since formatting won't hold. Using screenshot instead:
Browser (javascript):
This button's data, once received by Python:
You'll notice that I'm doing something weird by giving all the inputs the same name. On all big name browsers this is treated like a stack and python builds a friendly tuple from it. However, on some obscure browsers, like my nokia, whatever ipad uses, and my grandma's Netscape browser like to only send the first variable and ignores the rest...
Is there an easy way to simply reformat this <form> data to pass a stack with out scaring mobile and archaic browsers?
Thank you, internet people!
edit: can't use code box since formatting won't hold. Using screenshot instead:
Browser (javascript):
Code: Select all
<form action="/" method="post"><input type="hidden" name="ad" value="a3jk3j5k3j335h"><input type="hidden" name="ad" value="1"><input type="hidden" name="ad" value="1"><input type="hidden" name="ad" value="3"><input type="submit" value="+add user"></forum>
Code: Select all
>>>self.js
('a3jk3j5k3j335h','1','1','3')
You'll notice that I'm doing something weird by giving all the inputs the same name. On all big name browsers this is treated like a stack and python builds a friendly tuple from it. However, on some obscure browsers, like my nokia, whatever ipad uses, and my grandma's Netscape browser like to only send the first variable and ignores the rest...
Is there an easy way to simply reformat this <form> data to pass a stack with out scaring mobile and archaic browsers?
Thank you, internet people!