Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
79
rated 0 times [  80] [ 1]  / answers: 1 / hits: 107966  / 13 Years ago, fri, september 23, 2011, 12:00:00

I'd like two submit buttons on a form i have my team building, one above the fold, and one below. I'm getting complaints from my tech team about adding it because it requires some server side coding to make sure the user doesn't click it more than once. Apparently they have it one button, but to add that validation to two would be a problem.



Can you not just call the button the same thing, with the same ID and wouldn't the form treat it as one button?



Another option I thought would be for new button to fire a click even on the other button. Then they still have one click even for the form, but I get my two buttons. How would I write that?



Thanks,
Adma


More From » html

 Answers
10

I'm only familiar with ASP.net and C# buttons, but using C# you could wire two different buttons to the same click event handler. You could also do it client side by triggering the primary buttons click event with your secondary button. Here's a VERY simple example:



HTML



<input type=button id=primaryButton onclick=ExistingLogic() />
<input type=button
id=secondaryButton
onclick=document.getElementById('primaryButton').click() />

[#89954] Thursday, September 22, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mckaylab

Total Points: 311
Total Questions: 120
Total Answers: 93

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
;