unnati
unnati

Reputation: 65

inserting data from multile form when button click

I am working on project which have zend framework.In that I want to create different form for different languages.which insert same data but language is different in mysql database table.I have no idea how can I insert all forms data in table by only submitting one form.in short I want a logic for inserting data from all different languages form just by submitting one language form.

Upvotes: 0

Views: 47

Answers (1)

Norman
Norman

Reputation: 79

You only need one form, guide your user by passing different language parameters. for example

http://127.0.0.1/controller/action/lan/en

Then show different Form Label to your user using the parameter you got (In your view)

$lan = $this->_getParam("lan");
if($lan == "en"){
    $this->view->labelForInput1 = "English";
    $this->view->labelForInput2 = "Another English Label";
}
else{
// define different language label here
}

Finally using a hidden input to pass the language choice into your form Thus when you want to show the result to user, you will able to know which language you should use.

Upvotes: 1

Related Questions