|
[SOLVED] 2 different actions, same form
I have a form where I can add BBCode to a textarea and on it is 3 buttons. 2 of them are submit buttons and the other is a reset button
One of the submit buttons is a Submit button and the other is a Preview button.
I would like the Submit button to do one action like saving the record in a database (which is pretty straightforward) but I want the Preview button to do exactly what it says on the tin.....Preview whatever is in textarea.
How do I go about having 2 different actions depending on which button is pressed? My first and only thought is JavaScript but I have no clue as I've never needed to do this before
|