V
V
viktorross2021-03-16 21:06:23
JavaScript
viktorross, 2021-03-16 21:06:23

js error why?

hello, tell me why an error can fly out, and of course the script does not work

Error: Syntax error, unrecognized expression: unsupported pseudo: icontains

jQuery(document).ready(function(){
  {/literal}
    // field 1
    $('select[name="qs_{$v.depending.caption1}"]').find('option:icontains("{$location_array[$v.depending.caption1]|rawurlencode}")').attr("selected",true);
    selDepending(1, 'qs_{$v.depending.caption1}', 'qs_{$v.depending.caption2}', '{$v.depending.id}', {if $multi_depending && in_array($v.dep_id, ','|explode:$multi_depending)}this.form.qs_category.value{else}0{/if}, 0, '', 0, '', '{$live_site}', '' );

    // field2
    {if in_array($v.depending.caption2, $location_fields) && $location_array[$v.depending.caption2]}
    {literal}
    setTimeout(function() {{/literal} $('select[name="qs_{$v.depending.caption2}"]').find('option:icontains("{$location_array[$v.depending.caption2]|rawurlencode}")').attr("selected",true);{literal}}, 500);{/literal}
...

<select name="qs_{$v.depending.caption1}" id="qs_{$v.depending.caption1}" {if $multi_depending && in_array($v.dep_id, ','|explode:$multi_depending)}disabled="disabled"{/if} onchange="selDepending(1, 'qs_{$v.depending.caption1}', 'qs_{$v.depending.caption2}', '{$v.depending.id}', {if $multi_depending && in_array($v.dep_id, ','|explode:$multi_depending)}this.form.qs_category.value{else}0{/if}, 0, '', 0, '', '{$live_site}', '' )">





<select disabled='disabled' name="qs_{$v.depending.caption2}" id="qs_{$v.depending.caption2}"
  {if $v.depending.no>=3}onchange="selDepending(2, 'qs_{$v.depending.caption2}', 'qs_{$v.depending.caption3}', '{$v.depending.id}', 0, 0, '', 0, '' , '{$live_site}', 'dep_id_qs_{$v.depending.caption1}')"{/if}>
    <option value="">{$v.depending.name2}</option>
  </select>

.....


what could be wrong? in theory, the script should search in option

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeniy _, 2021-03-16
@GeneD88

.find('option:icontains -> .find('option:contains
?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question