简体   繁体   English

如何使用JavaScript填写表格来从parse.com中的数据库中获取建议(自动完成),例如汽车制造商?

[英]How to get suggestions(auto complete) from database in parse.com using javascript on filling a form,example for car manufacturers?

我正在创建一个应用程序,用户必须在其中输入他们的汽车详细信息。我已经创建了一个表格,并且能够成功将输入数据更新到Parse.com上的数据库中。我想使用parse.com中的数据库来创建自动完成建议作为下拉菜单。

We use jQuery and Javascript to create this HTML code 我们使用jQuery和Javascript创建此HTML代码

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  });
  </script>

For the strings in the availableTags[] array, a parse.com cloud code loops through all the "suggestions" in the parse.com classes and stream them to the client's browser. 对于availableTags []数组中的字符串,parse.com云代码循环遍历parse.com类中的所有“建议”,并将它们流式传输到客户端的浏览器。

An real life example is available for your review at https://formgram.parseapp.com/formPage?formObjectId=KjuAOvq57n&formInstanceObjectId=Mb5iZfiWX6 您可以在https://formgram.parseapp.com/formPage?formObjectId=KjuAOvq57n&formInstanceObjectId=Mb5iZfiWX6查看真实示例

The state field is an autocomplete field. 状态字段是自动完成字段。 Currently, only 4 states have been added to this autocomplete. 目前,仅4个州已添加到此自动完成功能中。

You can even add more states to this autocomplete if you'd like by simply typing in the name of another state at https://formgram.parseapp.com/formPage?formObjectId=twDYgj32wK 如果您愿意,甚至可以通过在https://formgram.parseapp.com/formPage?formObjectId=twDYgj32wK中键入其他状态的名称,来向此自动完成功能添加更多状态

If you need additional help, let me know. 如果您需要其他帮助,请告诉我。

More details are available at http://jqueryui.com/autocomplete/ 有关更多详细信息,请访问http://jqueryui.com/autocomplete/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从parse.com获取完整的课程 - How to GET a complete class from parse.com 如何使用query.find();从parse.com获取json响应 在网络应用中使用javascript? - how to get json response form parse.com using query.find(); using javascript in web app? 从parse.com javascript获取Geopoints - Get Geopoints from parse.com javascript 如何从javascript中的Parse.com Rest API获取objectId - How to get objectId from Parse.com rest api in javascript 如何使用JavaScript显示来自parse.com数据库的图像? - How do I display images from parse.com database using javascript? 如何使用Javascript从Parse.com中的URL保存文件 - How to save a file from a URL in Parse.com using Javascript 如何使用云代码/ javascript从parse.com中的2个类获取数据 - How to get data from 2 classes in parse.com using cloud code/javascript 如何使用JavaScript从Parse.com中的类中的Object获取信息 - How to get information from Object in class in Parse.com using JavaScript 嵌套查询使用javascript和parse.com数据库返回UNDEFINED - Nested Queries returning UNDEFINED using javascript and parse.com database 如何使用Parse.promise javascript [parse.com]定义诺言数组并获得结果数组 - How to define an array of promises and get an array of results using Parse.promise javascript [parse.com]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM