ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Is it Possible to Give an ID or Name to Popup Button
Title:
B
I
{code}
?
Is it possible to assign a value to id or name attributes of popup buttons so i can select it in JQuery easily or assign a handlers for click event or something like that. so the buttons rendering be like that: <button type="button" id="btnOk"></button> <button type="button" id="btnCancel"></button>
Save Changes
Cancel
micro0o2011
asked at 10 Jan 2015
depends which popup you're using, jQueryUI or bootstrap, with bootstrap you could modify the bootstrapPopup.js and set the id from Tag parameters; you could still select the buttons using jquery without having ids; you can assign handlers using the .Button extension like here: http://demo.aspnetawesome.com/PopupDemo#Buttons
at 11 Jan 2015
Omu
I am using PopupFormAction. Example of what i need to do: i need to bind keyboard key to perform on ok and cancel buttons, so i need to do somthing like that if(// condition: if hotkey of ok is pressed) { $("#btnOk").click() }
at 11 Jan 2015
micro0o2011
the ok button of the popupform submits the form so you could add an id to your html form and instead of $("#btnOk").click() do $('#myform').submit(); you could also do this without having id on form using jquery .closest you need to have a tag with id inside the form, something like this: $('#mypivot').closest('form').submit() and to close the popup $('#mypivot').closest('.awe-popup').data('api').close(); now if you need custom buttons you can do .UseDefaultButtons(false) and add your own using .Button
at 11 Jan 2015
Omu
Answers
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