Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

I've got a problem with the input search. I follow this thread : viewtopic.php?f=8&t=7620

Every thing works fine if I only have one input (criteria).
but If I got two select option the request must match the first&& the second even if the first criteria is empty.

Here 's my code
Code: Select all
   <cms:form name="quicksearch" id="quicksearch" anchor='0'>
      <cms:if k_success >

         <cms:if frm_societe_type!='-' >
            <cms:set my_search_str="<cms:concat my_search_str ' | societe==' frm_societe />"  scope='global'/>
         </cms:if>

         <cms:if frm_typebien_type!='-' >
            <cms:set my_search_str="<cms:concat my_search_str ' | typebien==' frm_typebien />"  scope='global'/>
         </cms:if>

      </cms:if>



         <cms:input type="dropdown"
               opt_values='Société=- | JAREGE  | YOREHANE | JILOC | URBAN | EMPAJO | SCI LA CHARENTELLE'
               opt_selected='-'
               name="societe" id="societe" />

         <cms:input type="dropdown"
               opt_values='Type de Bien =- | Location à l étranger | Location local commercial | Location maison | Appartement à louer à la nuité | Maison à vendre | Terrain à vendre'
               opt_selected='-'
               name="typebien" id="typebien" />

         <cms:input type="submit" class="fbsubmitbtn" value="Rechercher" name="submit"/>

   </cms:form>




I think it's because my default option (all 'societe' or all 'typedebien') doesn't work.
In fact when i select anything and press search I got that :
Debug :| societe==- | typebien==-
Except that it must be empty or must contain all criteria.

Any idea??
Thanks
Hi :)

The problem, I think, are the variables highlighted below that you are trying to use -
<cms:if frm_societe_type!='-' >
<cms:set my_search_str="<cms:concat my_search_str ' | societe==' frm_societe />" scope='global'/>
</cms:if>

<cms:if frm_typebien_type!='-' >
<cms:set my_search_str="<cms:concat my_search_str ' | typebien==' frm_typebien />" scope='global'/>
</cms:if>

You need to use frm_societe and frm_typebien instead (i.e. the names of the cms:input prefixed by 'frm_').

Does this help?
Hi KK
Thanks for your quick support.
That's work !! :D
Regards,
3 posts Page 1 of 1