File tree Expand file tree Collapse file tree
apply/funds/templates/funds Expand file tree Collapse file tree Original file line number Diff line number Diff line change 100100 < button
101101 class ="w-full sm:w-auto btn btn-primary "
102102 type ="submit "
103+ name ="submit "
103104 disabled
104105 >
105106 {% trans "Submit for review" %}
Original file line number Diff line number Diff line change 4747 }
4848
4949 // Block multiple form submits.
50+ let clickedButton = null ;
51+ submitButtons . forEach ( function ( button ) {
52+ button . addEventListener ( "click" , function ( ) {
53+ clickedButton = button ;
54+ } ) ;
55+ } ) ;
56+
5057 form . addEventListener ( "submit" , function ( ) {
5158 // Use setTimeout with 0 delay to ensure form submission begins
5259 // before the buttons are disabled, allowing their values to be included
5360 setTimeout ( function ( ) {
5461 submitButtons . forEach ( function ( button ) {
5562 button . setAttribute ( "disabled" , "disabled" ) ;
56- if ( button . textContent ) {
57- button . dataset . originalText = button . textContent ;
58- button . textContent = "Submitting..." ;
59- }
6063 } ) ;
64+ if ( clickedButton && clickedButton . textContent ) {
65+ clickedButton . textContent = clickedButton . textContent . trim ( ) + "…" ;
66+ }
6167 } , 0 ) ;
6268 } ) ;
6369
You can’t perform that action at this time.
0 commit comments