Forum OpenACS Development: ad_form question

Collapse
Posted by Ola Hansson on
How do you tell ad_form to set a radiobutton to be "checked" by default? That is, I want to have the "Yes" button pressed when I request the page with the form.

The code below yields two unpressed buttons...

ad_form -form {
    some_key:key
    {name:text(text)                      {label "Name *"}
	{html {size 50}}}
    {charter:text(textarea)               {label "Charter"}
        {html {rows 3 cols 50 wrap soft}}        optional}
    {description:text(textarea)           {label "Description"}
        {html {rows 10 cols 50 wrap soft}}       optional}
    {enabled_p:integer(radio)             {label "Enabled"}
        {options {{Yes 1} {No 0}}}}   
} -select_query {

...
Collapse
Posted by Dave Bauer on
Ola, Set the value property of the element.
Like this:
{value 1}
or whatever value you want to default to.