google charts bad request - google-visualization
does anyone know why this is a bad request?
http://chart.apis.google.com/chart?cht=lxy&
chd=t:0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100&
chco=3072F3,ff0000,00aaaa,541269&chs=1000x200&chxt=x,y&
chxl=0:|18|18|18|18|18|19|19|19|19|19|19|20|20|20|20|20|20|21|21|21|21|21|21|22|22|22|22|22|22|23|23|23|23|23|23|0|0|0|0|0|0|1|1|1|1|1|1|2|2|2|2|2|2|3|3|3|3|3|3|4|4|4|4|4|4|5|5|5|5|5|5|6|6|6|6|6|6|7|7|7|7|7|7|8|8|8|8|8|8|9|9|9|9|9|9|10|10|10|10|10|10|11|11|11|11|11|11|12|12|12|12|12|12|13|13|13|13|13|13|14|14|14|14|14|14|15|15|15|15|15|15|16|16|16|16|16|16|17|17|1:||3.5|7|10.5|14
trying to plot four lines on a graph
thanks
Google Charts has a maximum length of URL that it will handle without giving that error. I'm not sure what that limit is precisely, but your URL is 4774 characters long and I think the limit is just over 2000 characters.
You may need to use the simple or extended data encoding instead of text encoding. Text encoding is the least space-efficient way of encoding data for the Google Charts API. See the Data Formats API documentation for more information.
As Greg said, your URL is too long.
The maximum length of a URL is not determined by the Google Chart API, but rather by web browser and web server considerations. Currently, URLs that are over 2048 characters in length when URL-encoded (e.g., | becomes %7C) are not recommended. As web browsers and servers evolve, this number may change. See http://www.boutell.com/newfaq/misc/urllength.html for a more in-depth discussion.
Have a look at the Google Chart API FAQ for more information
Although this is already answered correctly I thought it might be useful to provide a practical solution using your data:
<form id='graphform' name='graphform' action='https://chart.googleapis.com/chart' method='POST' target='graph_target'>
<input type="hidden" name="cht" value='lxy' />
<input type="hidden" name="chd" value="t:0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9,31.7,32.4,33.1,33.8,34.5,35.3,36,36.7,37.4,38.1,38.8,39.6,40.3,41,41.7,42.4,43.2,43.9,44.6,45.3,46,46.8,47.5,48.2,48.9,49.6,50.4,51.1,51.8,52.5,53.2,54,54.7,55.4,56.1,56.8,57.6,58.3,59,59.7,60.4,61.2,61.9,62.6,63.3,64,64.7,65.5,66.2,66.9,67.6,68.3,69.1,69.8,70.5,71.2,71.9,72.7,73.4,74.1,74.8,75.5,76.3,77,77.7,78.4,79.1,79.9,80.6,81.3,82,82.7,83.5,84.2,84.9,85.6,86.3,87.1,87.8,88.5,89.2,89.9,90.6,91.4,92.1,92.8,93.5,94.2,95,95.7,96.4,97.1,97.8,98.6,99.3|100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100" />
<input type="hidden" name="chco" value="3072F3,ff0000,00aaaa,541269" />
<input type='hidden' name='chs' value='1000x200' />
<input type="hidden" name="chxt" value="x,y" />
<input type="hidden" name="chxl" value="0:|18|18|18|18|18|19|19|19|19|19|19|20|20|20|20|20|20|21|21|21|21|21|21|22|22|22|22|22|22|23|23|23|23|23|23|0|0|0|0|0|0|1|1|1|1|1|1|2|2|2|2|2|2|3|3|3|3|3|3|4|4|4|4|4|4|5|5|5|5|5|5|6|6|6|6|6|6|7|7|7|7|7|7|8|8|8|8|8|8|9|9|9|9|9|9|10|10|10|10|10|10|11|11|11|11|11|11|12|12|12|12|12|12|13|13|13|13|13|13|14|14|14|14|14|14|15|15|15|15|15|15|16|16|16|16|16|16|17|17|1:||3.5|7|10.5|14" />
</form>
<iframe name='graph_target' src='' style='width:1000px;height:200px;'></iframe>
<script type="text/javascript">
document.forms["graphform"].submit();
</script>
This generates a rather uninformative graph!
Related
Why is the FORM scope showing fewer values than were actually submitted by this AJAX file uploader?
I'm not sure I understand how to phrase my question, but I believe it's specific to ColdFusion's handling of certain AJAX form data, despite my reference to a specific JavaScript plugin. I'm trying to implement the FilePond uploader on a ColdFusion 2011 server, and I've got it configured well on the frontend (it uploads the files to tmp folder just fine), but my problem is not knowing how to get ColdFusion to process the extra metadata it sends along with it on every upload. This data doesn't look to me like it comes in the same format as plain old hidden input fields. When I inspect the network request with Dev Tools, it looks different to me than other forms I've processed. There are two "filepond" entries, one a JSON object and the other the binary image. When I < cfdump var="#form.FilePond#">, I only get the tmp uploaded file path, which I can process. But how do I access the JSON in my screenshot containing the "parentid"? Nothing I've tried, like form.FilePond[1], seems to work and throws errors. Update with output from CF form processing page: 1st line is output of Form.FilePond. 2nd is cfdump of Form. 3rd is cfdump URL. 4th is cfdump of getHttpRequestData()
Update: Bugs filed for CF2016 (core support ending for CF11 after April 2019) CF-4204103 - FORM scope is missing values when same named fields include type=file CF-4204102 - sameFormFieldAsArray setting doesn't work with enctype="multipart/form-data" After some testing, I've concluded it's a ColdFusion bug. Issue: The issue seems to occur under these conditions Request is a multipart/form-data POST Contains multiple fields with the same name At least 1 of those fields is a file field i.e. type="file" The first field submitted (within the group) is NOT a file field Under those conditions, ColdFusion seems to ignore everything before the first file field. (If you check the filepond source ut confirms the metadata field is submitted before any file fields). That's why the metadata value doesn't appear when dumping the FORM scope. Note, the this.sameFormFieldsAsArray setting has no effect because it doesn't work with multipart/form-data requests. Test Case Below is a test case. Notice the results are what you'd expect when the same named field occurs after the first file field? <cfdump var="#form#" label="Form scope"> <form method="post" enctype="multipart/form-data"> <br>First: <input type="file" name="fileFirst"><br> <input type="text" name="fileFirst" value="Lions"><br> <br>Last: <input type="text" name="fileLast" value="Tigers"><br> <input type="file" name="fileLast"><br> <br>Middle: <input type="text" name="fileMiddle" value="Bears"><br> <input type="file" name="fileMiddle"><br> <input type="text" name="fileMiddle" value="Oh My"><br> <input type="submit"> </form> Workaround This blog provides a workaround using an undocumented feature of the FORM scope. Using form.getPartsArray() provides access to both "filePond" fields allowing you to extract the value of the dropped field. Not ideal, but does work until the issue is fixed. Keep in mind this is an undocumented feature, so be sure to isolate the code for easier alterations in case Adobe alters or removes that function in the future (which they've done before, so fair warning!). <cfscript> // dump raw form fields for (part in form.getPartsArray()) { writeDump({ fieldName = part.getName() , isFile = part.isFile() , fieldValue = (part.isFile() ? part.getFileName() : part.getStringValue()) } ); } </cfscript>
How to use regex to limit domains?
I'm making an html5 form and only want users to sign up with .edu or .gov email addresses. What would the regex look like for that? I know it must be checked serverside as well, but one step at a time. Example: <input type="email" pattern="[a-z0-9._%+-]+#[a-z0-9.-]+\.[a-z]{2,4}$" />
Building on How to validate an email address in JavaScript? I came up with this using a simplified RFC 2822 compatible pattern: [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*#((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9]\.)+(edu|gov) Regex Demo The major difference is how the domain part is evaluated. I took this from my previous answer. <form action="javascript:console.log('ok')"> <input type="text" name="domain" pattern="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*#((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9]\.)+(edu|gov)" title="Sorry, only email addresses from .edu and .org domains are allowed."> <input type="submit"> </form>
Add this: ^[a-zA-Z0-9_.+-]+#(?:(?:[a-zA-Z0-9-]+\.)?[a-zA-Z]+\.)?(domain|domain2)\.(edu|gov)$ Demo
Camunda Form failure: Value 'on' is not of type boolean
I am about to learn how to automate processes with Camunda and the Camunda Modeler. Therefore, I set up a small test process with two user tasks, a decision table and a service task. Everything works fine, except one of the user tasks. In the mentioned user task, I want to embed a little HTML-Form which looks like this: <form role="form" name="form"> <div class="form-group"> <label for="download">Travel request to review</label> <a id="download" cam-variable-name="downloadRequest" cam-file-download="travelRequestDocument"></a> </div> <div class="form-group"> <label for="checkboxApproved">I approve this travel request.</label> <input id="checkboxApproved" type="checkbox" cam-variable-name="approved" cam-variable-type="boolean" class="form-control" /> </div> </form> I embedded it through the form key property in the Camunda Modeler: embedded:deployment:forms/approval.html When I go to Camunda tasklist (Camunda engine runs on local tomcat server) and open the task, it says: Form failure: Value 'on' is not of type boolean. I searched the internet back and forth for reasons which could cause this error, but I couldn't find anything useful. Maybe someone here has experience with this kind of problem? I would be very thankful :)
The solution is quite simple: I just have to replace the "boolean" with "Boolean" (uppercase 'b'). I hope this answer will save others from hours of research... (like me)
jquery cycle 2 pager doubles items
There is a similar question on here, but the solution doesn't work, and I can't comment on it, so I need to post a new question. <div class="cycle-slideshow" data-cycle-caption-plugin=caption2 data-cycle-pager="#cycle-pager" data-cycle-overlay-fx-sel=">div" > <div class="cycle-overlay"></div> <img src="/sites/default/files/images/banner_imag_1.jpg" title="Collaboratively administrate turnkey channels whereas virtual e-tailers." alt='Seamlessly empower fully researched growth strategies and interoperable internal or "organic" sources.' /> <img src="/sites/default/files/images/blue-sky-basin-vail_0.png" title="What if world-leading organizations teamed-up to develop and scale technology and business solutions to global poverty?" alt="Efficiently unleash cross-media information without cross-media value." /> </div> <div id="cycle-pager"></div> Instead of two pager items, I'm getting four. Any insight would be very appreciated. Thanks!
This probably happened because you have inserted library for pagination. All you need is delete the line: <script src="js/cycle/jquery.cycle2.pager.js"></script>
Django: How can I invisibly pass a variable to another template?
I have three templates in my project—we'll call them first.html, second.html, third.html. first.html gets a string from the user, using an <input> tag: <input type="radio" name="selection" value="example_string" /> second.html displays this string using {{selection}}. (In my views.py, I got the value using request.POST.get and render_to_response().) The question is: how do I send this value from second.html to third.html? One of my attempts—using a <span> tag to save the information in a variable—is illustrated below, but it doesn't seem to work. <span name="selection" value={{selection}}>{{selection}}</span> Edit: The following line works by creating a dummy single radio button. I don't know why it shouldn't be possible to create a variable without an <input> tag [visible to the user]. <input type="radio" name="selected" value={{selected}} checked="checked" />
You need to understand how the web works: each page is entirely separate, and is requested using a separate request. Your basic options are: save data on the client side, or post it back to the server. Both options can be performed with javascript, or posting back can also be performed by posting the form back to the server. If you want to send it back to the server, it will have to be stored in the current session, or in a model. There are many javascript libraries. If you want to use them, I suggest you google around the subject.
Answering my own question, now that I've found the answer on Django's documentation. There's a special kind of <input> tag precisely for this: "hidden". The following line accomplishes the same as was asked in the question, but without a dummy element visible to the user: <input type="hidden" name="selected" value={{selected}} />