Not sure where this one goes...
I have a grid of companies that allows updates to the address of the company. At the end of that update, I need to ask the user if they want to update the contacts associated with that company to the same address.
Here the code that calls the javascript function:
ClientScript.RegisterStartupScript(Me.GetType(), "ConfirmMessageBox", "confirmAddressChange(); ", True)
If hfAddressChange.Value <> String.Empty Then
Dim x As String = "Do Something here"
End If
And here is the javascipt it is calling:
function confirmAddressChange()
{
var res = (confirm('"Update Contact Addresses to Match?"')==true);
document.forms[0].hfAddressChange.valueOf = res;
}
Basically all I'm doing is getting the response from the user and putting it into a HiddenField on the form.
Everything SEEMS to be working fine, except that the IF statement that checks the HiddenField runs before the confirmation box is run.
How do I call the function and make sure it is run BEFORE I check for the value returned in the HiddenField?
Any suggestions would be GREATLY appreciated.
Thanks.
I have a grid of companies that allows updates to the address of the company. At the end of that update, I need to ask the user if they want to update the contacts associated with that company to the same address.
Here the code that calls the javascript function:
ClientScript.RegisterStartupScript(Me.GetType(), "ConfirmMessageBox", "confirmAddressChange(); ", True)
If hfAddressChange.Value <> String.Empty Then
Dim x As String = "Do Something here"
End If
And here is the javascipt it is calling:
function confirmAddressChange()
{
var res = (confirm('"Update Contact Addresses to Match?"')==true);
document.forms[0].hfAddressChange.valueOf = res;
}
Basically all I'm doing is getting the response from the user and putting it into a HiddenField on the form.
Everything SEEMS to be working fine, except that the IF statement that checks the HiddenField runs before the confirmation box is run.
How do I call the function and make sure it is run BEFORE I check for the value returned in the HiddenField?
Any suggestions would be GREATLY appreciated.
Thanks.