hi! i would just like to ask if it's possible to create two forms. like for example, in my first form,i have a pros,cons and recommend room fields while on the second form i have name, email,often play category(drop down) and gender fields.what i want is on the first form,upon clicking the submit,it will go the 2nd form and that 2nd form will catch the data from the 1st form. upon completing all the fields, that's the time that it'll be saved.
for example, here is my first method:
function UserReviewsCommentFormStepOne() {
// Create fields
$fields = new FieldSet(
new TextareaField("Pros","What did you like about this room?"),
new TextareaField("Cons","What did you not like in this room?"),
new OptionsetField("RecommendRoom",'Do you recommend this room?',array(
'Y'=>'Yes',
'N'=>'No'
)));
$actions = new FieldSet(new FormAction('UserReviewsCommentFormStepTwo', 'Submit'));
$validator=new RequiredFields('Pros','Cons','RecommendRoom');
$form = new Form($this, 'UserReviewsCommentFormStepTwo', $fields, $actions,$validator);
return $form;
}
and here is my second form that will catch the data from the first form:
function UserReviewsCommentFormStepTwo($data) {
if($data) {
$fields = new FieldSet(
new OptionsetField("Gender",'Sex',array(
'M'=>'Male',
'F'=>'Female'
)),
new DropdownField("OftenPlayCategory",'The Categories: ',$this->getOftenPlayCategory(),$this->val( 'ID' ),null,true),
new TextField("Name","Your Name"),
new TextField("Email","Your email address"),
new HiddenField("Pros","Pros: ",$data['Pros']),
new HiddenField("Cons","Cons: ",$data['Cons']),
new HiddenField("RecommendRoom","Recommend Room: ",$data['RecommendRoom'])
);
$actions = new FieldSet(new FormAction('ProcessUserReviewsForm', 'Submit'));
$validator=new RequiredFields();
$form = new Form($this, 'ProcessUserReviewsForm', $fields, $actions, $validator);
}
return $form;
}
upon doing this(running this), i get this error:
[User Error] Uncaught Exception: Object->__call(): the method 'getviewer' does not exist on 'Form'
POST /UserReviewsWidget_Controller/UserReviewsCommentFormStepTwo
can anyone help me on how to solve this question of mine?thanks :)