2

i am trying to have a functionality , where our app send verification email to confirm user to activate his/her online registration. i have below html code , where i want to open up a new window , when user clicks on "confirm email address" button.

<button id="emailVerificationBtn" onclick="javascript:openEmailVerificationPage('http://localhost:8080/myapp/tokens.html')"/>

and onclick, i am calling javascript to open up a new window, then after the verification gets completed.

       <script>
            function openEmailVerificationPage(url) {
                document.getElementById("eamilVerificationForm").action = url;
                window.open('', "TheWindow");
                document.getElementById("eamilVerificationForm").submit();
            }
        </script>

i have tested this html in browser , it was working fine, but when it was send to user email, and user tries to click the button, the new window is not opening up. it is not working inside an email. i have check in ie, Mozilla, chrome with pop-up blocker disabled. but i am facing button click problem within the email.

EDIT - my form

<form  id="eamilVerificationForm" method="post" target="TheWindow">
pappu_kutty
  • 2,378
  • 8
  • 49
  • 93
  • 1
    I notice in your getElementById calls, you're misspelling email in `eamilVerificationForm`. Could that be it? – Bill Turner Feb 17 '14 at 14:50
  • @BillTurner thanks for pointing out typo,, but that is not the issue.. it is working in plain browser, problem is when the html content goes to the email – pappu_kutty Feb 17 '14 at 14:54
  • 1
    most email clients disable javascript. what you could do is instead of use an `a` element and set the `target` attribute to `_blank` which will open up a new tab and set the appropriate url to it – anurupr Feb 17 '14 at 14:57
  • Was just about to say what anurupr said. JS probably isn't allowed in the email client you're trying. It may be enabled for some, but most will not allow it for security concerns: http://stackoverflow.com/questions/1088016/html-email-with-javascript – Bill Turner Feb 17 '14 at 14:59

1 Answers1

1

Is not necessary use javascript...

<a id="button_validation" href="http://www.ururlvalidation.com" target="_blank">Validate email</a>
Netzach
  • 321
  • 2
  • 13