Jump to content

Condition with autocomplete


niyassulaiman

Recommended Posts

In this code, this is always redirecting/forwarding to particular page. Could you please help me to navigate to different page on certain condition.

Suppose if the value of $product_array is greater than "200" go to one particular page, otherwise to second page.

 

 

$( "#search" ).autocomplete(

{

      minLength: 0,

      source: <?php echo $product_array;?>,   

     

   focus: function( event, ui )

          {

          $( "#search" ).val( ui.item.label );

          return false;

          },

 

  select: function( event, ui )

         {

         $( "#search" ).val( ui.item.label);

         $("#hsearch").val( ui.item.value );

         var url = '<?php echo Yii::app()->params["productURL"]. "'+ ui.item.value +'"."?lang=$lang"; ?>';

         window.location.replace(url);

         }

 

    });

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.