Jump to content
  • 0

2 инпута с автокомплитом


mcavalon
 Share

Question

доброе утро, делаю так:


<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$().ready(function() {
$("#autocomplete1").autocomplete({
source: "/admin/spendu/action/scripts/getCars.php"
});
});
$().ready(function() {
$("#autocomplete2").autocomplete({
source: "/admin/spendu/action/scripts/getGoods.php?car=" + document.getElementById('autocomplete1').value
});
});
</script>

Авто<br />
<input id="autocomplete1" type="text" style="width: 25em;" />
...
Название<br />
<input id="autocomplete2" type="text" style="width: 25em;" />

первый автокомплит работает, а второй нет, я не знаю как передать второму полю значение car из первого комплита

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Во-первых, ready нужен только один.

Во-вторых, для jQuery UI есть подробнейшая документация на официальном сайте и еще миллион разнообразных статей и заметок. Поищите, а лучше почитайте повнимательней документацию.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy