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

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.
 
S

Srini

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
 
R

Rajesh.V

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top