title: wordpress ajax form submission is not working?
body: <p>Here is the code..I think action i ajax not working and getting 403 error! using Wamp and running Wordpress on it</p>
  
  <p>js code
      jQuery('#InsertionForm').submit(</p>
  
  <pre><code>function (){
  var x = jQuery('#nm').val();
  var y = jQuery('#em').val();
  
  jQuery.ajax({
  type:"POST",
  
  url: "&lt;?php echo admin_url('admin-ajax.php'); ?&gt;",
  
  data: { 
          action: 'get_my_option',
          namo: x, 
          emao: y
      },
  
  success:function(){
      alert("working");
  }
  });
  
  return false;
  
  });
  </code></pre>
  
  <p>main plugin code ..please can anyone tell me ...the given bellow code is in right sequence or not?</p>
  
  <pre><code>    &lt;?php
  
  /*
  
  Plugin Name: lucky
  
  */
  
  
  //adding script files in HTML
  
  wp_enqueue_script('myscript', plugins_url('myscript.js', __FILE__), 
  
  array('jquery'), '', true);
  
  wp_localize_script( 'myscript', 'my_ajax_object',
  
              array( 'ajax_url' =&gt; admin_url( 'admin-ajax.php' ) ) );
  
  
  function get_my_option()
  
  {
  
      //do something
  
     alert("this is a function action: in ajax");
  
  }
  
  add_action("wp_ajax_nopriv_get_my_option", "get_my_option");
  
  add_action("wp_ajax_get_my_option", "get_my_option");
  
  
  
      #Shortcode function.........................................
  
  function html_form_code() {
  
      global $wpdb;
  
      # Input form fields.....
  
      echo '&lt;form method="post" id="InsertionForm"&gt;';
  
      echo '&lt;h3&gt;Insertion Form&lt;/h3&gt;';
  
      echo '&lt;p&gt;Your Name (required) &lt;br/&gt;';
  
      echo '&lt;input id="nm" type="text" name="namel" value="" size="40" /&gt;';
  
      echo '&lt;/p&gt;';
  
      echo '&lt;p&gt;';
  
      echo 'Your Email (required) &lt;br/&gt;';
  
      echo '&lt;input id="em" type="email" name="emaill" value="" size="40" /&gt;';
  
      echo '&lt;/p&gt;';
  
      echo '&lt;p&gt;&lt;input type="submit" name="submitbtn" value="Send"&gt; ';
  
      echo '&lt;/form&gt;';
  }
  
  function my_ajax() {
  
      $nom = $_POST['namo'];
  
      $emo = $_POST['emao'];
  
      global $wpdb;
  
      $wpdb -&gt; insert( 'lucky_wpdb', array('namel' =&gt; $nom, 'emaill' =&gt; $emo) 
  
  );
  
  echo 'Submitted';
  
  }
  
  
  
      //Shortcode working here....
  
  add_shortcode( 'sitepoint_contact_form', 'html_form_code' );
  
  ?&gt;
  </code></pre>