How to get submit button POST Data while submitting by JavaScript form.submit()?

It seems that you are submitting a different form than the one that contains the Delete button ( id=Novinky ). In this case you could add a hidden field in this form and set it's value to the value of the Delete button just before submitting it.

It seems that you are submitting a different form than the one that contains the Delete button (id=Novinky). In this case you could add a hidden field in this form and set it's value to the value of the Delete button just before submitting it: if (is_confirmed) { document. GetElementById('myhiddenfield').

Value = element. Value; document. GetElementById('Novinky').submit(); } UPDATE: Instead of attaching a click handler to the delete button you could do this: This will automatically post the value of the Delete button when you submit it.

UPDATE2.

My bad... I've accidentally deleted form's id while simplifying the example ;) I'd like to avoid using any additional hidden fields... I was wondering if I could somehow modify functionality of submit() or set the button to be POSTed... – Corvus Nov 18 '09 at 10:13 Please see my UPDATE. – Darin Dimitrov Nov 18 '09 at 11:22 This works as long as long as there aren't any different submit buttons in the form (eg. Edit, save etc.).. which is not my case (sorry, I should have made that clear... I guess I've oversimplified that example a bit :) ) – Corvus Nov 18 '09 at 13:08 Even if you have other submit buttons, only the value of the button you clicked will be posted which will allow you to determine it in your server side script.

– Darin Dimitrov Nov 18 '09 at 13:40 I was pointing out the fact that you'd still get the confirmation dialog... I can't think up any way to let handleSubmit() know which button was clicked without using click handlers and hidden fields again... any ideas? – Corvus Nov 18 '09 at 15:09.

I've just found out that this code does the trick: However, I'm still interested whether there is an answer to my original question.

Java Script document. Cookie = "button="+element. Value+";path=/; domain="+window.location.

Hostname+";"; PHP be sure to supply the php path. Or just set the path of the current page. E.

G: path=/sample don't include the php page.

Sorry, but I can't see how alert() has anything to do with what is sent in POST request.. : / – Corvus Nov 18 '09 at 10:19 That's a interesting solution, but my point was to make the script act the same way as the form would with JavaScript disabled, so the form would work both with and without JavaScript and it wouldn't have to be processed separately on the server side... hence the POST request – Corvus Nov 18 '09 at 15:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions