php - Duplicate search box, not getting any search result -


i have 2 search boxes, 1 desktop , 1 mobile version. created 2 versions because of different positions on website.
both has same code, mobile version not getting search results in url.

desktop working version url on submit button :

 index.php?route=product/search&search=test 

mobile version url (not sending data in url) :

index.php?route=product/search 

both of them has input :

<input type="text" name="search" placeholder="<?php echo $text_search; ?>"  value="<?php echo $search; ?>" /> 

i don't understand why mobile version not sending data.

there can 2 reasons-

1st - didn't added search input inside header tag (suggested ramesh)
2nd - if 1st done, have change in common.js file responsible searching, code added

$('#search input[name=\'search\']').on('keydown', function(e) { 

add code add class active input type,

$(this).addclass('active-header-input'); 

then have change line

 var value = $('header input[name=\'search\']').val(); 

because taking 1st input value , never take 2nd 1 change this

 var value = $('.active-header-input').val() ? $('.active-header-input').val() : $('header input[name=\'search\']').val(); 

now both input work.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -