I already created a register form.
I have 3 select-boxes. Day, Month, Year.
In my database I have one column called “Birthday” with the format of “date”.
Now I want to put all three together and insert the result into the database.
public function beforeSave($options = array()){
$this->data['User']['Birthday'] = $this->data['User']['Year'] . '-' . $this->data['User']['Month'] .'-' . $this->data['User']['Day'];
return true;
}
But this is not working 🙁
None of this fields (Day, Month,Year, Birthday) has validation rules..
How can I do this?
You can try the following code in your Model:
There must be following form fields should be available into your form: