ad_page_contract {

Simple edit form

This is a simple form to edit information into our table

Here you can write comments
 } {
     item_id:integer,optional
   }


    #start building the form
  
    ad_form -name photo_edit -html {enctype multipart/form-data} -form {

    {item_id:key}
 
   # build the form
    {title:text,nospell,optional              {label "Title"}
                                              {html {size 40}}}
    {description:text(textarea)               {label "Description of your photo"}
                                              {html {rows 4 cols 50} }}  
 
} -select_query {
        select title,description from slideshowgallery where id = :item_id
} -validate {
        {description
         {[string length description] >=0}
         "\"description\" must be a string containing three or more characters"
	}
} -edit_data {

        db_dml do_update "
            update slideshowgallery 
            set title = :title,description=:description 
            where id = :item_id"
} -cancel_url photos-list \
  -after_submit {
        ad_returnredirect photos-list
        ad_script_abort
}


