ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
InitPopupForm How to prevent pressing ESC to close the PopupForm
Title:
B
I
{code}
?
@(Html.Awe().InitPopupForm() .Name("createFMWPU_CUST") .Height(400) .Width(800) .Url(Url.Action("Create", "WPU_CUST")) .Title("新增資料") .UseFormData(true) .Close("WPU_CUST_detailrefresh")) InitPopupForm How to prevent pressing ESC to close the PopupForm Update: I need this function Because I often need to press ESC to cancel the characters pressed by the input method when inputting Chinese, I will accidentally close the window.
Save Changes
Cancel
RayBen
asked 5 days ago
Answers
B
I
{code}
?
in `awem.js` find this code and add a line: function closeOnEsc(e) { if (which(e) === keyEsc) { if ($(e.target).is('input,textarea')) return; // line to add if (!popup.data('esc')) { api.close({ esc: 1 }); } popup.data('esc', null); } } mcont.on(skeyup, closeOnEsc); note: since you're using an older version your code might look a little different, so you'll have to do some adjustments
Save Changes
Cancel
Omu
answered 5 days ago
I can't see mcont.on(skeyup, closeOnEsc); I have see this modal.on(skeyup, closeOnEsc); in awem.js
4 days ago
RayBen
your awem.js is different because you're using an old version awesome, I'll update my answer
4 days ago
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK