Forum OpenACS Development: Re: multiple hidden widget?

Collapse
Posted by Jeff Lu on

Thanks Robert. Thats the workaround that I came up with too. Im really sorry for the ambiguity of my first post. Let me explain what I am really doing. I made 2 pages. A delete page and a delete confirmation page. For the delete page this is how I did it:


<form action="message-delete">
<multiple name="messages">
<input type="checkbox" name="message_id" value="@messages.message_id@"> </multiple> So the for the tcl of the confirmation page I did this:
ad_page_contract { } { 
        {message_id:multiple}
}
#here message_id is a multiple to get the multiple values #from the delete page
ad_form -name delete-message -form {
{submit.x:text(submit) {label "delete"}}
{cancel.x:text(submit) {label "cancel"}}
{message_id:integer(hidden),multiple {value $message_id}}

#for the message_id part I tried both values and value when I tried using values the form was resubmitted but was not rendered properly because of validation error on the values part. When I tried using value the values of the message_ids were preserved but it returns a list with one element like this : {val1 val2 val3} as opposed to {val1} {val2} {val3} when using multiple

} -after_submit {
#submit code here
}

now my problem is the ad_form part. I tried Dave's suggestion (thanks Dave!) but it seems that ad_form sees that the -values part for the hidden widget is invalid. So when It resubmits to itself the message_id which should be a multiple is now a list.