function registerEnterpriseAutocomplete(id)
{
- $(".enterpriseName").each(
- function() {
+ $('.enterprise_name').each(function() {
if (id == -1 || this.name == "jobs[" + id + "][name]") {
- $(this).autocomplete($.plURL("search/autocomplete/entreprise"),
- {
- selectOnly:1,
- field:this.name,
- matchSubset:0,
- width:$(this).width()
- });
+ $(this).autocomplete({
+ source: $.plURL('search/autocomplete/entreprise/') + this.name,
+ change: function(event, ui) {
+ if (ui.item != null && ui.item.field != null) {
+ $(this).val(ui.item.field);
+ }
+ }
+ });
}
- });
-
- $(".sectorName").each(
- function() {
- if (id == -1 || this.name == "jobs[" + id + "][subSubSectorName]") {
- $(this).autocomplete($.plURL("search/autocomplete/subSubSector"),
- {
- selectOnly:1,
- field:this.name,
- matchSubset:0,
- width:$(this).width()
- });
- }
- });
+ });
}
// {{{1 Multiusage functions
}
// Build the page
+ $page->addJsLink('jquery.ui.xorg.js');
$page->addJsLink('education.js', true, false); /* dynamic content */
$page->addJsLink('grades.js', true, false); /* dynamic content */
$page->addJsLink('profile.js');
{/if}
{else}
{if t($job.tmp_name)}{$job.tmp_name} <small>(en cours de validation)</small>{else}
- <input type="text" class="enterpriseName{if t($job.name_error)} error{/if}" size="35" maxlength="100"
+ <input type="text" class="enterprise_name{if t($job.name_error)} error{/if}" size="35" maxlength="100"
name="{$jobpref}[name]" value="{$job.name}" />
{/if}
{/if}