-1

I have a function which stores the data and after that function I wanted to give an popup message with link. I am able to submit data and create an popup using alert. But adding link in text is something I want. Below is the code I tried.

<!DOCTYPE html>
<html>
<base target="_top">

    <head>
    <script type="text/javascript">
    
    
          
    function myfunction(from){
    (function($){
    var id = $("#id");
    var wnum = $("#wnum");
   var id = id[0]['value']
   var wnum = wnum[0]['value']

    
    
    
      if(from == 'submit'){
    submitData(id,wnum) // data submitted
    var str = "Inform us!";
   
   var result = str.link("some_link");
   alert("Thank you for submitting the form. "+result);
}   
})(jQuery);
}
</script>
       
<body>
  <div class="cen">
    <div class="wrapper">    
        <h1>Font Selector</h1>
        <fieldset class="fontForm grid">
    <div class="grid-cell">
            <div class="grid-cell size1of1">
    <label for="fname">Order Id</label>
    <input type="text" id="id" name="id" placeholder="Enter order id" >
    <label for="fname">WhatsApp Number</label>
    <input type="text" id="wnum" name="wnum" placeholder="Enter WhatsApp number">
      <p><button onclick="myfunction('submit')">Submit</button></p>
    </div>          
    </div>   
</body>
</html>

How could I do this?

ABCD
  • 730
  • 1
  • 13
  • 31
  • Possible duplicate: [https://stackoverflow.com/questions/966848/can-i-incorporate-a-link-in-a-message-box-in-javascript](https://stackoverflow.com/questions/966848/can-i-incorporate-a-link-in-a-message-box-in-javascript) – Rob Moll Jun 29 '20 at 13:43
  • Does this answer your question? [link in alert boxes javascript](https://stackoverflow.com/questions/16973240/link-in-alert-boxes-javascript) – Swati Jun 29 '20 at 13:43

1 Answers1

1

You cannot with alert. You will have to build an alert dialog that does not use it, e.g. using bootbox or something you build yourself.

Quentin Roy
  • 7,677
  • 2
  • 32
  • 50