Jump to content

Admin produit : problème d'autocompletion


Recommended Posts

Bonjour,

 

Je viens d'ajouter un nouveau champ dans l'onglet information de mes produits en admin. J'ai voulu intégrer un autocomplete sur ce champ, mail il ne se lance pas.

<td style="padding-bottom:5px;">
    <input size="55" type="text" id="product_type" name="product_type" value="{$product->product_type|escape:html:'UTF-8'}" style="width: 130px; margin-right: 5px;" />
    <script type="text/javascript">
    $(document).ready(function() {
        $('#product_type').autocomplete({
            source: function(request, response) {
                $.ajax({
                    url: "ajax.php",
                    dataType: "json",
                    data: { term: request.term, ajaxProductType: 1 },
                    success: function(data) { response(data); }
                });
            }, 
            minLength: 3,
            select: function( event, ui ) {
                $(this).val(ui.item.value);
            }
        });
    });
</script>
</td>

Il n'y a aucune erreur dans le console.

 

Merci d'avance pour vos réponses

Edited by jojohn (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...