Form with more submits and submiting by Enter?

Edit: you say your layout can't handle that. Either: 1. Change the layout.

Functionality is more important, and for layout there is more than one way to do it. 2. Have the form not check if "recalculate" or "submit" was pressed, but rather if the shown price was correct with the calculated prize.

Example: User buys 1 item, value 3 dollar. User buys 2 items, value 5 dollar. Total prize: 13 dollar.

User now changes the 1 item into 4 items. 3 dollar becomes 12 dollar, but he doesn't hit recalculate. Have a field in your form that shows the total amount (a hidden field is nicest).

When the user submits the form, redo the calculation. If the calculated prize equals the prize in the hidden field, the user knew the final correct prize. If it differs, reshow the form mentioning "You changed your shopping cart, the total prize has been updated to reflect these changes.

Verify the amount and submit to purchase" or something.

I'm not sure if that can be done (i.e. Might be a CSS problem as there is a lot of HTML in between the buttons). It's a pity, that the type="button" won't submit the form :( That would be lovely you can have as many buttons to submit as you want but only the type="submit" would be used when submiting with enter/javascript – TomáÅ¡ Fejfar Jan 26 at 14:54 Unfortunately the HTML can't be manipulated that way :( – TomáÅ¡ Fejfar Jan 26 at 15:02 So, you cannot manipulate the HTML, and you can't use Javascript, and you want to solve this problem which already each browser treats differently?

– Konerak Jan 26 at 17:02 I can modify HTML, but I can't switch the position of the buttons :( It's undoable using CSS for the layout I have :( – TomáÅ¡ Fejfar Jan 26 at 19:50 Edited the answer with another possible solution, then. – Konerak Jan 267 at 8:45.

Did you read the The solution MUST NOT use javascript as the frontend has to be useable without JS enabled. Part? – Konerak Jan 26 at 14:36 sorry, Konerak is right.

Can't use JS :( – TomáÅ¡ Fejfar Jan 26 at 14:47 1 ok sorry, then rearrange the buttons in the markup. The first will get the focus (in most browsers). Then use CSS to change the order of the buttons on the display layer again.

– Spliffster Jan 26 at 14:50 Yes it would be, problem is that there is a lot of HTML in between them :( I'll ask my CSS coder - he's a wizard! :D – TomáÅ¡ Fejfar Jan 26 at 14:56.

You should be able to decide that server-side. When a button is clicked it's name-value pair is submitted, but when return is pressed it isn't. So change your server-side script to do "recalculate" when the recalculate name-value is submitted and to contine in all other cases.

Actually, I just tested that: when you hit enter, the browser appears to submit the form using the first button it found, and it does pass that button name (tested using Opera). – Konerak Jan 26 at 14:42 This is what I got when I submit it using enter: "recalculate"=> string(13) "Recalculate" – TomáÅ¡ Fejfar Jan 26 at 14:52.

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