简体   繁体   中英

Possible way to resolve conflict on click action button

I am using bootstrap library on button:

<input type="submit" onclick="$(this).button('loading')" name="submit" data-loading-text="Loading..." class="btn btn-primary"/>

and this JsFiddle would describe my problem.

However i want to perform both the event synchronously. two event: 1. text area validation & 2. loading state of button

PS after button press, my page is getting reloaded, so no point to include button state 'reset'

Thanks in advance for help

finally got solution:

Either you can apply loading state on form submit event <form method="post" action="" onsubmit="$(this).find('.btn-primary').button('loading')"> , like this jSFiddle

or you it can also be handled by this JsFiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM