Button on click should ask for email before taking to a url or link

Discussão em 'Angular' iniciado por Rizwan Shaikh, Janeiro 9, 2025.

  1. What I am trying to achieve for coupons website (https://www.dealivore.in/store/oyo-rooms-coupons) is that when someone tries to click on the button it should open a box wherein they input their email id and once submitted it should take them to the offer page.

    Now this is a coupon code right now it just reveals the code to the end user.

    Tried this but doesn't work

    <input type="text" id="txtNumber">
    <input type="button" onclick="openPage()" value="Show The Page">
    <script type="text/javascript">
    function openPage() {
    var value1 = document.getElementById('txtNumber').value;
    var url="http://www.domainname.com/" + value1 + ".pdf";
    //alert(url);
    window.open(url,"_blank");
    }
    </script>

    Continue reading...

Compartilhe esta Página