Jump to content

two actions for a form -Is this possible?


Vidya_tr

Recommended Posts

I have a form which creates a question  and enters choices for the question(to upload a quiz)

There are three blank spaces for choice entry.

there is a button in the form which on click should create one more blank space for an extra choice

I use the $_SERVER['PHP_SELF"] as the form action when the button is clicked ,and the space for extra choice is created on the page.

After the choices are entered,I have a SAVE button whose action is to post the entries to another page.

 

How can I write the form action to do both functions???

Link to comment
Share on other sites

JavaScript is not necessary, just have two submit buttons that pass different values to the processing page. Then include logic to perform the appropriate action based upon the button used to submit the form. Of course, you will need to determine a "default" action to take if the user submits via the enter key.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.