开发者

Django and Lytebox - posting form data

I'm trying to display poll results using lytebox but can't work out how to pass either GET/POST variables to the page I'm calling.

Lytebox is working fine as this loads the page ok:

<a href="/polls/1/results"  rel="lyteframe" title="Example Poll" rev="width: 400px; height: 450px; scrolling: yes;">Results</a>

But I want to get the value of the selected radio buttons for processing. I tried using a javascript function to include the choice at the end of the url, ie. /polls/1/vote?choice=1 and redirecting:

&开发者_开发知识库lt;input type="radio" name="choice" id="choice1" value="1" />

    <a href="javascript:vote();"  rel="lyteframe" title="Example Poll" rev="width: 400px; height: 450px; scrolling: yes;">Vote</a>

But of course, this just loads the results in a new page. Lytebox doesn't seem to allow for any POST/GET variables? or is it just me?


Because lytebox requirements include the rev and rel attributes to be set in an <a tag I couldn't use it to send GET/POST data, I ended up going with jquery (using thickbox's tb_show function) and a AJAX call to send the selected choice to my script and show the results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜