How to do Confirmation while submit button with dynamic Text?
-
Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance
-
Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance
If I faced this problem, I would do the follwoing: I will set the submit button property
visble = False
,Caption="Yes"
and create another invisible reset button withcaption = "No"
and invisible Lable to hold the confirmation message and pushButton withcaption = "Submit/Send"
which is actually not a submit button Once the user click the virtual submit, set all invisible controls to visible, generate the message with dynamic text and path it to the lable If the user clieked "Yes" it will submit If he/she clicked "No", the form is cleared and set visible controls to invisible again I hope you like the ideaMohammed Gouda foreach(Minute m in MyLife) myExperience++;
-
If I faced this problem, I would do the follwoing: I will set the submit button property
visble = False
,Caption="Yes"
and create another invisible reset button withcaption = "No"
and invisible Lable to hold the confirmation message and pushButton withcaption = "Submit/Send"
which is actually not a submit button Once the user click the virtual submit, set all invisible controls to visible, generate the message with dynamic text and path it to the lable If the user clieked "Yes" it will submit If he/she clicked "No", the form is cleared and set visible controls to invisible again I hope you like the ideaMohammed Gouda foreach(Minute m in MyLife) myExperience++;
Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?
-
Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance
I assume you have a HTML submit button. Write some javascript function on "onclick" event. Inside jvascript fiunction you must put a javascript confirmation which returns true or false. Accordingly your function will also return true or false. Its the property of Submit button which automatically stops sending data to server if onlcick function returns false. pseudocode
function onclickfunction ()
{
var answer = confirm("you are going to place an order for X share for X rates. are you sure")
if(answer)
{
return true;// goes to server
}
else
{
return false// always stops sending data to server.
}
}
you have call above function in this way:NB: Dont miss "return" statement from calling code.
Thanks, Arindam D Tewary
-
Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?
Here is a quick example, you would want to make this a dynamic function though to get whatever values you need from the form controls. <asp:Button ID="Button1" OnClientClick="return confirm('You have selected \'X\' number of shares....'); " runat="server" Text="Button" />
-
I assume you have a HTML submit button. Write some javascript function on "onclick" event. Inside jvascript fiunction you must put a javascript confirmation which returns true or false. Accordingly your function will also return true or false. Its the property of Submit button which automatically stops sending data to server if onlcick function returns false. pseudocode
function onclickfunction ()
{
var answer = confirm("you are going to place an order for X share for X rates. are you sure")
if(answer)
{
return true;// goes to server
}
else
{
return false// always stops sending data to server.
}
}
you have call above function in this way:NB: Dont miss "return" statement from calling code.
Thanks, Arindam D Tewary
Sorry for the cross post, I never saw your reply (didn't realize the replies wrapped pages).
-
Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?
Snehal_14_2_83 wrote:
but can't we popup message into messagebox like desktop application?
The only way is javascript (like shown in the below posts) But, take care that client can disable javascript code
Mohammed Gouda foreach(Minute m in MyLife) myExperience++;