SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form with two "actions"?!?

    I have a form where I want to be able to do 2 different things depending on which button I press?

    My form tag looks like this:
    HTML Code:
    <form id="mbpForm" method="post" action="admin.php?page=sitepages&ez=do_createpage" onsubmit="changeValues();">
    At the bottom of my form I want 2 buttons. One ordinary submit button which do the action and then a button which changes the values using the changeValues() part....

    How do I do this?

    Thanks in advance ;-)

  2. #2
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use an ordinary submit button to submit the form to the action's url and just a plain button with onclick event handler to call changeValues().


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •