PDA

View Full Version : Two Submit buttons in form


knigh7
03-01-2004, 03:54 AM
Hello,

Does anyone know how to make 2 submit buttons work,

Basically i have a list with diffrent products, the user selects a product and from there they can delete that product or edit its information.

I am using a javascript to check the validation (for edit) and "are you sure" alert for the delete. i am using <form bla bla onsubmit="(return funcname(this)> ....


Regards,
Ahmad

MikeParent
03-01-2004, 02:31 PM
Create two javascript funcitons on your page: product_delete() and product_edit() or some such.

Make your own buttons (rather than using a submit button) to execute (using the javascript onClick event) the appropriate javascript call. The javascript function would then change the form action page and submit the form.

knigh7
03-02-2004, 01:47 AM
Thank you so much,

Although I do not know how to make my own buttons, a simple google search should remedy that.

Thank you again
ahmad

MikeParent
03-02-2004, 03:44 AM
No sweat. Just wrap an anchor tag around an image:

<a href="javascript: product_edit() ;"><img src="blah.gif"></a>

knigh7
03-05-2004, 01:32 AM
I would've never ever thought of that...

Thank you, i can see using this method for many things... :)

MikeParent
03-05-2004, 03:47 PM
I used it a lot. PS: I had to space the code weird to prevent smileys, so dont just do a copy paste :-)

knigh7
03-08-2004, 06:53 AM
Got it, thanx
q- do they have tim hortons in halifax, they are in every corner in Ontario????

i miss a large double double

i hope they open one in london england :)

MikeParent
03-08-2004, 08:54 AM
They are everywhere here as well... I have a suspicion they put addictive substances in the coffee (besides caffeine). The Tim's crowd is very nearly a cult following :-)

I prefer second cup myself.

knigh7
03-09-2004, 01:36 AM
No wonder i have been craving for it,,,,,, sweet addictive substance....

please see if you can help me with the
How can i have a backup of websites on another hosting company??????? posting