Forum OpenACS Q&A: How do I change text on submit button for ad_form

Question 1: When I use this tcl to create a form, what additional tcl do I need to change the text on the submit button from the default of "submit"?
   template::form::create note-del-confirm
    template::element::create note-del-confirm note_id -value $note_id -widget hidden
    template::element::create note-del-confirm confirm -value 1 -widget hidden

Question 2: If I use ad_form to create a form, how do I change the submit button text?

Question 3: Is there any documentation for any of the form-building functions, aside from what's in the api browser for ad_form and, the (almost non-existent) function notes for other functions in ACS Templating 4.5?

Collapse
Posted by Simon Carstensen on
1) You can use the -label parameter, something along the lines of -label "Text On Button"

2) Same thing, only different syntax: {label "Text On Button" }

3) Jon Griffin has written good documentation on using ad_form at:

http://jongriffin.com/static/openacs/ad_form/using-ad-form

Collapse
Posted by Joel Aufrecht on
What I can't figure out is how to apply that flag to the submit button. I spent half an hour doing trial and error with various permutations of element and widget and submit and got nowhere. So my question is, for the statement
template::form::create note-del-confirm
X -label "Text On Button"
What is X?
Collapse
Posted by Matthew Geddert on
template::element::create note-del-confirm submit \
        -label "My New Text On The Submit Button" \
        -datatype text \
        -widget submit
the best notes i have found on almost everything related to openacs is in the code itself... just grep for whatever you are looking for from withing the packages directory... you'll either find the proc itself or a way that some package uses the proc you are trying to understand.