Page 1 of 1

Multiple Submit buttons?

Posted: Thu Mar 18, 2010 5:19 pm
by angelicodin
Hey ya guys. I've been working on this little project to learn how to do some things and I realized I could use it for a CMS I've been working on for a few months now.

One of the modules in the system is a blogger. And it's coming along, but I'm finding that I would like to have a preview function of some kind with the blog part of it.

So I did some poking around on goggle and what not to see how you can do more than one submit button and I got some answers but nothing that seemed to work for me.

Is there a simple way of setting up two submit buttons, like say one sends the data to one page and then another?

Re: Multiple Submit buttons?

Posted: Thu Mar 18, 2010 5:28 pm
by M2tM
Yes. You'll have to use javascript and onclick to alter the target of the form.
<form id = "MyForm" action = "submit.php">
<input type = "submit" onclick = "document.getElementById('MyForm').action = 'preview.php';" name = "PreviewSubmit" value = "Preview"/>
<input type = "submit" name = "fullSubmit" value = "Submit"/>
</form>

Something like this is what you want.

Re: Multiple Submit buttons?

Posted: Thu Mar 18, 2010 5:34 pm
by angelicodin
/cry

yeah that's what I thought. Been trying that but, don't know why, but with the rich text editor (also in java) and clears the information somehow.

Thanks for confirming this for me.