Re: php & javascript mission
If you give each submit button a different name you can check which one was pressed using the isset function:
PHP Code:
if (isset($_POST['delete'])) {
/* do delete */
} else if (isset($_POST['change'])) {
/* do change */
}
Re: php & javascript mission
Ok Thanks I Assume That U Don't Have An Answer How To Do It Only With Js.
And What About My Other Section Of The Question?
Tnx
Re: php & javascript mission
And the other part to your question is? This is the PHP forum but why use Javascript to deal with a submitted form? The whole point of submitting the form is to send the data back to the server. :confused:
Re: php & javascript mission
i think that u r wrong why should i spend resources if i can do it on the client side?:-)
Re: php & javascript mission
Do what exactly, on the client side. It's very hard to get things right when you are being so vague.
Re: php & javascript mission
Quote:
Originally Posted by itaisass
i think that u r wrong why should i spend resources if i can do it on the client side?:-)
you can create 2 forms using javascript with different actions.
have each button have an onClick event (or use an event handler which is the better way) and call a different function based on which button is pressed. Inside the function you can call the submit function of each form separately.
Re: php & javascript mission
... and then your website will be absolutely useless to anyone who has javascript disabled.
either way, if you're not looking for a PHP solution, why did you post this in the PHP forums? we don't take kindly to doing things on the client side around these parts.
javascript forum