GWT How to specify name of Submit Button?
-
11-06-2021 - |
Question
I have integrated my Spring application with GWT. My application has a Login page with 2 submit button (1) Login and (2) Sign Up / Register.
Now i have added these two buttons in login page successfully.
But how can i specify their name so that i can differentiate in controller which button is submitted and redirect my flow accordingly.
How to set name of submit buttons in GWT?
Please help.
Solution 2
Finally got the solution
DOM.setElementAttribute(buttonElement,"name","register");
OTHER TIPS
If you can edit the html code on your page you can simply use an if/else condition and statement. Even with pages that use basic html you still do this by using javaScript to write in the button code.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow