Conditional JavaScript confirmation box??......

  • Thread starter Thread starter RyanG
  • Start date Start date
R

RyanG

Say I have an app that, using the server & database, verifies some
information the user has submitted (EX: verifying to make sure the
address matches our record).

What I want to be able to do is IF the information matches what's in
the database, when he hits the submit button he will be redirected to
the next page. If the information does NOT match, I want a JavaScript
confirmation box to appear informing the user that some information
does not match and ask if the transaction should continue.

I want the confirmation box to pop up ONLY when the information fails
the verification. If it passes the page should just redirect to the
next.

How can this be accomplished??

Thanks in advance.
 
On the form load can you try populating the old address
variable in hidden variables. After which you can use JAVA
script to compare the old and new address.
if hiddenoldaddress <> oldaddress.value
button1.attributes.add("onclick"," return confirm( 'are
you sure')

Regards,
Srini
 
Do Page.RegisterStartupScript and
inject
var ans = false;
ans = confirm("Transac can continue?");
if (var)
--- js to redirect him ;
 
Back
Top