1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1162 Views |
-
Custom form question

15 May 2009 at 9:41pm Last edited: 16 May 2009 12:01am
OK, simple question. I have this custom form:
function TestForm() {
$fields = new FieldSet(
new TextField('NumA', 'Number A'),
new TextField('NumB', 'Number B')
);
$actions = new FieldSet(
new FormAction('doSubmitNumbers', 'Calculate')
);$form = new Form(
$this,
'Form',
$fields,
$actions
);
return $form;
}The only thing I want the function doSubmitNumbers to do, is to perform some calculation (say, add NumA and NumB) and show the result on the page when it redirects back. I know how I would use doSubmitNumbers to save to the database, but I actually don't want to save to the database, just show the result of the calculation... How would I go forward?
Thanks!
Edit: wording.
-
Re: Custom form question

18 May 2009 at 7:06pm
doSubmitNumbers doesn't save anything to the database per se, what its used for is "Run doSubmitNumbers() when you have submitted the form" as to what doSubmitNumbers() does - it could write the DB or it could in your case be used to redirect the user and add numbers
| 1162 Views | ||
|
Page:
1
|
Go to Top |


