Ryan,
The problem is very basic, however a bit tricky: How to manipulate the name of the vars, in order to get them dynamically set. The category's ad_form elements have their names as cat_0356, cat_098 ...
That means 0356 is the category id and $cat_0356 is also a variable that contains the category of the child.
I am trying to deal with something like $cat_${category_id} but i get the following error bellow.
For example in the loop:
foreach {category_id category_name} [videos::get_categories -package_id $package_id] {
set tmp "$cat_${category_id}"
ns_log Notice "$tmp"
}
why doesn't $cat_${category_id} become $cat_0356 and moreover it does not write the value held in $cat_0356?
[04/Jun/2010:10:16:15][4386.3056024464][-default:0-] Error: POST http://192.168.6.35:8090/videos/videos-new?
referred by "http://192.168.6.35:8090/videos/videos-new?video_id=881";
can't read "cat_": no such variable
while executing
"set tmp "$cat_${category_id}""
("foreach" body line 2)
invoked from within
"foreach {category_id category_name} [videos::get_categories -package_id $package_id] {
set tmp "$cat_${category_id}"
ns_log Notice "$temp"
}"
("uplevel" body line 9)
invoked from within
"uplevel #$level $on_submit"
(procedure "ad_form" line 620)
invoked from within
"ad_form -extend -name video -form {
} -new_request {
set creator [videos::get_user_name -user_id [ad_conn user_id]]
set read_term 0
} -edit_re..."
("uplevel" body line 80)
invoked from within
"uplevel {
ad_page_contract {
This is a form to upload video