GET VALUE FROM CONFIRM BOX

string scriptString = "";Response.Write(scriptString);Is there a way lớn determine if you select yes or no?


Bạn đang xem: Get value from confirm box

*

*

*

Confirm returns a boolean value indicating ok or cancel (true means ok, false means cancel).

You can use it like this:

if(confirm ("Are you sure you want to lớn Close this period.")) //they clicked okelse //they clicked cancelread more about it here: https://developer.mozilla.org/En/DOM/Window.confirm


*

You should store the result of the confirm in a hidden field value like this:

if (confirm("Are you sure you want khổng lồ proceed?")==true) hiddenField.value = "true"; return true; else hiddenField.value = "false"; return false;and then fetch the value of the hidden field from C#


Xem thêm: Top 7 Phần Mềm Cd Ảo Nào Tốt: Ultraiso, Daemon, Clonedrive, Top Phần Mềm Tạo Ổ Đĩa Ảo Miễn Phí

*

Thanks for contributing an answer to Stack Overflow!

Please be sure to answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding khổng lồ other answers.Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.


Post Your Answer Discard

By clicking “Post Your Answer”, you agree lớn our terms of service, privacy policy và cookie policy


Not the answer you're looking for? Browse other questions tagged c# javascript asp.net popup or ask your own question.


How bởi vì you remove all the options of a select box & then add one option & select it with jQuery?
Why does my JavaScript code receive a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, while Postman does not?
Site kiến thiết / logo sản phẩm © 2022 Stack Exchange Inc; user contributions licensed under cc by-sa. Rev2022.5.5.42046


Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device & disclose information in accordance with our Cookie Policy.