title: Get form data and put into a href link?
body: <p>I'd like to send a SMS on website by</p>
  
  <pre><code>&lt;a href="sms:+12345678?body=form data"
  </code></pre>
  
  <p>and popup the SMS application on cellphone.</p>
  
  <p>I'd like user to fill the form, javascript get form data and insert into body= in a link.</p>
  
  <p>Does javascript or jquery can do it?</p>
  
  <p>Here is the code I've tried with input
  sms-link.min.js is for make SMS links compatible cross devices, but it only works on Android not iOS.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
  &lt;input type="text" maxlength="5" id="ca_no"&gt;
  &lt;div class="col-md-12"&gt; &lt;a href="sms:+4268800" class="btn btn-warning" onClick="location.href=this.href+'?body=EDS&amp;nbsp;'+card_no;return false;"&gt;Register&lt;/a&gt; &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="sms-link.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  var card_no=document.getElementById('ca_no').value;
      document.addEventListener('DOMContentLoaded', (function () {
          link = new SMSLink.link();
          link.replaceAll();
      }), false);
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>enter data and click link won't work, it will works when click back with same data which already filled.</p>