Forum OpenACS Q&A: Re: passing list from 1 form to other

Posted by Brian Fenton on
I suppose the first thing to ask is why are you using embedded TCL in your .adp file? It's probably better programming practice to only put HTML in your .adp file and to have a separate file1.tcl for your TCL code.

Anyway, to answer your question, because a list is just another string, all you need to do is create a  HTML input field in your file1.adp and accept it in the ad_page_contract of your file2.tcl. You should url-encode it first.

So, add this just before the </form> in file1.adp:
<% ad_urlencode $descriptive_question %>
<input type=hidden name=descriptive_question value=@descriptive_question@>

Then in file2.tcl, in your ad_page_contract have something like:
ad_page_contract {
} {
  {descriptive_question {}}

Your descriptive_question list will then be available in file2.tcl.