1792 Posts in 588 Topics by 560 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1509 Views |
-
Reset Form Action

12 February 2009 at 2:07am Last edited: 12 February 2009 2:11am
I have follwing problems
1. After calling ResetFormAction i am unable to clear the validation error message.
2. How can i get the form values in the submission tab of CMS as like UserDefinedFormPlease help me out.
Here is code snippetfunction Form() {
return new Form($this, "Form", new FieldSet(// List your fields here
new TextField("ContactPerson", "Contact Person"),
new EmailField("Email", "Email address"),
new DropdownField("Reason", "Your Reason", array(
"Sales" => "Sales",
"Marketing" => "Marketing")),
new PhoneNumberField( $name = "PhoneNumber",
$title = "Phone Number "
),
new TextareaField( $name = "Remarks",
$title = "Remark",
$rows = 8,
$cols = 3
)
), new FieldSet(
// List the action buttons here
new FormAction("SubmitAction", "Submit"),
new ResetFormAction("ClearAction","Clear")),
new RequiredFields("ContactPerson","Email","Reason")
);
}/**
* This function is called when the user submits the form.
*/
function SubmitAction($data, $form) {// Create a new RemarksDetails object and load the form data into it
$Submissions = new ContactDetails();
$form->saveInto($Submissions);
// Write it to the database. This needs to happen before we add it to a group
$Submissions->write();
$email = new Email();
}
| 1509 Views | ||
|
Page:
1
|
Go to Top |

