title: Validation of url in javascript
body: <p>I have created a small form which have one field for input the url and the other one is submit button and i want to validate the input url through the javascript so that in case of correct url it will show an alert box.Is it possible with javascript? If yes , please help me to getting this through the below code.</p>
  
  <pre><code>&lt;form name="lln-form" class="llnfrm" id="lln-form" id="bulk-form" action="" method="post" onsubmit="javascript:event.preventDefault();return  submit_ajax();"&gt;
  &lt;fieldset style=""&gt;
  &lt;label&gt;Enter URL:&lt;/label&gt;
  &lt;input type="text" name="url" placeholder = "enter your url"&gt;
  &lt;/fieldset&gt;
  &lt;input class="lln-button button button-primary" type="submit" name="lln-submit" id="llnbuton" value="Save" onsubmit = "saveURL()"; /&gt;
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
  function saveURL()
  {
  &lt;?php
          if(isset($POST['url'])==true&amp;&amp;empty($POST['url'])==false){
  $url=$POST['url'];
  if(filter_var('$url',FILTER_VALIDATE_URL)==true)
      echo "VAlid URL";
  }
      ?&gt;
  }
  </code></pre>
  
  <p></p>