小编use*_*766的帖子

Jquery自动完成从第一个字符开始

我认为之前有人问过这个问题,但是我无法使用我的脚本.当我开始输入输入字段时,例如我以字母AI开头,每个标签都包含字母A.

我只想要以字母A开头的标签.

这是我的脚本:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
.ui-autocomplete {
max-height: 100px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 100px;
}
</style>

$(function() {
$( "#tags" ).autocomplete({
source: [{
        label: "Apple",
        value: "http://www.apple.com"},
    {
        label: "Google",
        value: "http://www.google.com"},
    {
        label: "Yahoo",
        value: "http://www.yahoo.com"},
    {
        label: "Bing", …
Run Code Online (Sandbox Code Playgroud)

javascript jquery jquery-ui

4
推荐指数
1
解决办法
1万
查看次数

尝试记住表单输入时未定义的索引

我有一个表单,我想在提交失败后记住输入.

我无法弄清楚出了什么问题.

我正在使用这个:

<?php 

    session_start();
    $_SESSION['isb-vraag1'] = $_POST['isb-vraag1'];
    $_SESSION['isb-vraag3'] = $_POST['isb-vraag3'];

?>
<?php 
    if(isset($_POST['Submitform']) && $_SERVER['REQUEST_METHOD'] == "POST")
    {
        $strerror = "";
        if(empty($_POST['isb-vraag1']))
        {
            $strerror = $strerror."U dient deze vraag in te vullen<br />";
        }
        if(empty($_POST['isb-vraag2']))
        {
            $strerror = $strerror."U dient deze vraag in te vullen<br/>";
        }
        if(empty($_POST['isb-vraag4']))
        {
            $strerror = $strerror."U dient deze vraag in te vullen<br/>";
        }
        if(empty($_POST['isb-vraag5']))
        {
            $strerror = $strerror."U dient deze vraag in te vullen<br/>";
        }
        if(empty($_POST['isb-vraag6']))
        {
            $strerror = $strerror."U dient deze vraag in …
Run Code Online (Sandbox Code Playgroud)

php forms post input

0
推荐指数
1
解决办法
126
查看次数

标签 统计

forms ×1

input ×1

javascript ×1

jquery ×1

jquery-ui ×1

php ×1

post ×1