Multiple actions for one form

Is it possible to have multiple actions for one html form? I am trying to get the data from the form into our mysql database and also send the data to our CRM’s server to add to the db there. For the mysql db I use php and that works fine on its own. For the CRM’s server, I just use their url as the action for the form and that also works on its own. The problem is when I try to combine them, the action property overriders the PHP, so the CRM gets the data but not our local DB. Is there a way to have the php set the form action property after it adds info to the db? 2 e-mail messages are also sent using the form data and PHP. The CRM is salesforce.com if anyone has any experience with that.

thanks :smiley:
dk

Can’t you first send them via PHP, which then sends them to both MySQL and CRM ?

The main problem is the only way to send it to CRM is to set their url as the form’s action. I was thinking of creating a second form with hidden fields using php and then submitting it to CRM that way. Is javascript the only way to auto-submit a form or can it be done with PHP? I’m just starting out with PHP so I’m not really sure how I could send them both at the same time. Is there a way to call a PHP function from the form’s onsubmit property or is that only for javascript? That way I could have it run the function to add to the local db and still have the form action be the CRM.

thanks
dk

Yeah, that should work. I think you can do it with both PHP and Javascript.

I’ve looked around and it doesn’t look like it will work using the onsubmit. Does anyone else know of a way to do this?