Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用geocomplete jquery地理编码提交表格';t后纬度&;经度_Jquery_Forms_Geocoding - Fatal编程技术网

使用geocomplete jquery地理编码提交表格';t后纬度&;经度

使用geocomplete jquery地理编码提交表格';t后纬度&;经度,jquery,forms,geocoding,Jquery,Forms,Geocoding,我正在使用一个表单提交纬度和经度。如果我只是按下下面的触发器,它就会工作并填满lat和lng气田。但是,当我添加SubmitjQuery代码时,它会提交空白字段。我知道这是一些时间的事情,因为我可以看到领域填补,但不是通过邮寄。但我不明白,有什么建议吗 <script> $(document).ready(function(){ // Area for any jQuery $("#geocomplete").geocomplete({ details:

我正在使用一个表单提交纬度和经度。如果我只是按下下面的触发器,它就会工作并填满lat和lng气田。但是,当我添加SubmitjQuery代码时,它会提交空白字段。我知道这是一些时间的事情,因为我可以看到领域填补,但不是通过邮寄。但我不明白,有什么建议吗

<script>
  $(document).ready(function(){
  // Area for any jQuery
    $("#geocomplete").geocomplete({
      details: "form",
      types: ["geocode", "establishment"]
    });

    $("#geoform").submit(function() {
      $("#geocomplete").trigger("geocode");
      alert('Handler for .submit() called.');
      return true;
    });
  });
</script>


<form id="geoform" method=post action="/foo.php">
  <input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
  <!--<input id="find" type="button" value="find" />-->
  <input type="submit" value="Go" />

  <fieldset>
    <input name="lat" type="text" value="">
    <input name="lng" type="text" value="">
    <input name="query" type="hidden" value="true">
  </fieldset>
</form>

$(文档).ready(函数(){
//任何jQuery的区域
$(“#地理完整”)。地理完整({
详情:“表格”,
类型:[“地理编码”、“机构”]
});
$(“#地理表单”).submit(函数(){
$(“#地理完整”).trigger(“地理代码”);
警报('调用了.submit()的处理程序');
返回true;
});
});

我从提交功能中删除了触发器,并添加了延迟

<script>

      $(document).ready(function(){
      // Area for any jQuery
        $("#geocomplete").geocomplete({
          details: "form",
          types: ["geocode", "establishment"]
        });

        $("#submit-button").click(function() {
          $("#geocomplete").trigger("geocode");
          setTimeout("$('#geoform').submit();",500);
        });
      });
    </script>


    <form id="geoform" method=post action="/foo.php">
      <input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
      <!--<input id="find" type="button" value="find" />-->
      <input id="#submit-button" type="button" value="Go" />

      <fieldset>
        <input name="lat" type="text" value="">
        <input name="lng" type="text" value="">
        <input name="query" type="hidden" value="true">
      </fieldset>
    </form>

$(文档).ready(函数(){
//任何jQuery的区域
$(“#地理完整”)。地理完整({
详情:“表格”,
类型:[“地理编码”、“机构”]
});
$(“#提交按钮”)。单击(函数(){
$(“#地理完整”).trigger(“地理代码”);
setTimeout($('#geoform').submit();”,500);
});
});

我从提交功能中删除了触发器,并添加了延迟

<script>

      $(document).ready(function(){
      // Area for any jQuery
        $("#geocomplete").geocomplete({
          details: "form",
          types: ["geocode", "establishment"]
        });

        $("#submit-button").click(function() {
          $("#geocomplete").trigger("geocode");
          setTimeout("$('#geoform').submit();",500);
        });
      });
    </script>


    <form id="geoform" method=post action="/foo.php">
      <input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
      <!--<input id="find" type="button" value="find" />-->
      <input id="#submit-button" type="button" value="Go" />

      <fieldset>
        <input name="lat" type="text" value="">
        <input name="lng" type="text" value="">
        <input name="query" type="hidden" value="true">
      </fieldset>
    </form>

$(文档).ready(函数(){
//任何jQuery的区域
$(“#地理完整”)。地理完整({
详情:“表格”,
类型:[“地理编码”、“机构”]
});
$(“#提交按钮”)。单击(函数(){
$(“#地理完整”).trigger(“地理代码”);
setTimeout($('#geoform').submit();”,500);
});
});