Wanting multiple people to receive notification when a form is filled

Hi,
I’ve been playing with PHP for a little while, but have come across something I can seem to figure out.

When someone fills out a time off request in our intranet, an email should go to both their manager and the department head. In the form, they select their manager’s name. In the code, that looks something like this:

Deb Peterson

Down below, we set out who should receive notification, but right now it’s only going to the department head. That looks like this:
else if (document.getElementById(‘Request_Type’).value == “OtherRequest”){
document.getElementById(‘recipient’).value=document.getElementById(‘Manager_Email’).value=‘[email protected]’;
}

I’m almost positive that the = needs to be replaced for the email to go two places. I just can’t seem to guess what should be there instead.

Thanks!

Being as this is a PHP forum, and I don’t trust JavaScript to handle stuff like this, I would be utilizing the backend to figure out who to send the emails to.

In basic form, the values in the select dropdown should be the ID of the manager. From that ID, you should be able to determine who the Dept Head is. So, you grab the two email addresses and whatever mail system you use, sends them.

As of right now, how do you decided whom the Dept Head is for the requester?

Sponsor our Newsletter | Privacy Policy | Terms of Service