J
J Sahoo
I have an asp button on my form. If user clicks the button then my
Javascript code Confirm pops up with "Ok" & "Cancel" button. If the
user clicks "Ok" from my pop-up then I do my vbMethod doApproveIt().
This works great if the Javascript returns true and I show the message
that the record is approved.
But if the user does not select "OK", chooses "cancel" button then
doApproveIt() method never executes. What I want is, how can I get the
RESPONSE of the user (either true or false) in a variable and
accordingly I want to show message to the user. Now I can not show any
message if the user chooses "cancel", since my method is not executed.
If I remove the return from the Confirm() method, doApproveIt() vb
method executes whteher user presses "OK" or "Cancel", But I need to
check the response in my vb method (what the user pressed), What do I
check to see the response, please provide me some sample code if
possible.
Thank you.
Sahoo J
Here is the code I have in my program:
<asp:button id="btnApprove" onclick="doApproveIt" runat="server"
Height="56px" Width="172px"
ForeColor="#C00000" Font-Size="Large" Font-Bold="True"
Text="Approve"></asp:button>
// The following code is in my pageLoad event.
btnApprove.Attributes("OnClick") = "return confirm('Are you sure, you
want to Approve this Record?');"
// VB Code
Sub doApproveIt(ByVal Source As Object, ByVal E As EventArgs) ' this
executes if value is TRUE , user confirms delete
createApproval("1") ' Approve was selected
' what do I check to see if the user has pressed CANCEL button, I need
to show msg
End Sub
Javascript code Confirm pops up with "Ok" & "Cancel" button. If the
user clicks "Ok" from my pop-up then I do my vbMethod doApproveIt().
This works great if the Javascript returns true and I show the message
that the record is approved.
But if the user does not select "OK", chooses "cancel" button then
doApproveIt() method never executes. What I want is, how can I get the
RESPONSE of the user (either true or false) in a variable and
accordingly I want to show message to the user. Now I can not show any
message if the user chooses "cancel", since my method is not executed.
If I remove the return from the Confirm() method, doApproveIt() vb
method executes whteher user presses "OK" or "Cancel", But I need to
check the response in my vb method (what the user pressed), What do I
check to see the response, please provide me some sample code if
possible.
Thank you.
Sahoo J
Here is the code I have in my program:
<asp:button id="btnApprove" onclick="doApproveIt" runat="server"
Height="56px" Width="172px"
ForeColor="#C00000" Font-Size="Large" Font-Bold="True"
Text="Approve"></asp:button>
// The following code is in my pageLoad event.
btnApprove.Attributes("OnClick") = "return confirm('Are you sure, you
want to Approve this Record?');"
// VB Code
Sub doApproveIt(ByVal Source As Object, ByVal E As EventArgs) ' this
executes if value is TRUE , user confirms delete
createApproval("1") ' Approve was selected
' what do I check to see if the user has pressed CANCEL button, I need
to show msg
End Sub