Forum OpenACS Q&A: Form wdgets with submit

Collapse
Posted by Ben Chan on
I've created a widget that consists of a textbox, a dropdown, and a submit button.  It's similar to having a form within a form.

Using ad_form, how would I write the -on_submit portion of code to detect if it's the default submit pushed for the form, or if it's my widget submit that was pressed?  Is there a better way to do this?

Thanks for any help you may be able to provide

Collapse
Posted by Ben Chan on
I just made the submit buttons in my widget to be named formbutton:NAME...

by calling template::form::get_button, I can identify which button was pressed.

Not sure if that's the best way, but just using that for now inside of ad_form