Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Problems
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 4th, 2011, 12:16 PM
ayorofrance ayorofrance is offline
 
Join Date: Sep 2010
Posts: 430
Default Dropdown boxes behaving strangely on Chrome

Hi Eric,

In my shop 30208 I am trying to use dropdown boxes instead of UL lists due to the number of items in the filters.

I thought I'd set it all up all right - it works fine in Firefox... however I am seeing some strange behaviour on Chrome.

If I go to a category page and click one of the sort options both filter (Model and Price) dropdown boxes disappears.

If I select an item in one of the filters the other dropdown box disappears...

Would you have any idea what might be causing this?

Thanks!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out.

Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers.
  #2  
Old February 4th, 2011, 12:56 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hmm... I don't know...

If you remove onchange="this.form.submit()" from your forms, does it still disappear?
  #3  
Old February 4th, 2011, 03:46 PM
ayorofrance ayorofrance is offline
 
Join Date: Sep 2010
Posts: 430
Default

It appears that it is the code to retain other filters that Chrome does not like...

If I take out the lines in bold it works:
Code:
<?php
function search_price_value($word) {
    $word = strip_tags($word);
    return $word;
}
?>

<form method="get">
    <?php if (@$_GET['word']){ echo "<INPUT TYPE='HIDDEN' NAME='word' Value='".search_price_value($_GET['word'])."'"; } ?>
  <?php if (@$_GET['ppp']){ echo '<INPUT TYPE="HIDDEN" NAME="ppp" Value="'.search_price_value($_GET['ppp']).'"'; } ?>
  <?php if (@$_GET['sort']){ echo '<INPUT TYPE="HIDDEN" NAME="sort" Value="'.search_price_value($_GET['sort']).'"'; } ?>

  <select name="price" id='store_dropdown_box'>
<option value="1-50"<?php if (@$_GET['price']=='1-50') {echo ' selected="selected"';}?>>Moins de 50</option>
<option value="50-100"<?php if (@$_GET['price']=='50-100') {echo ' selected="selected"';}?>>50 ~ 100</option>
<option value="100-150"<?php if (@$_GET['price']=='100-150') {echo ' selected="selected"';}?>>100 ~ 150</option>
<option value="150-200"<?php if (@$_GET['price']=='150-200') {echo ' selected="selected"';}?>>150 ~ 200</option>
<option value="200-250"<?php if (@$_GET['price']=='200-250') {echo ' selected="selected"';}?>>200 ~ 250</option>
<option value="250-"<?php if (@$_GET['price']=='250-') {echo ' selected="selected"';}?>>Plus de 250</option>

    </select>
    <input type="submit" value="Go" class="dfsbmt" />
</form>
  
<?php if (@$_GET['price']) { ?>
  <p><a href="[server.url type='fullpage' query='-price']">[X] Remove Filter</a></p>
<?php } ?>
Is there another way of doing this?

By the way I think it is an error in the standard Sorting Template that it does not retain any other filters that might be set... have you already flagged this?

Cheers,

Anders
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out.

Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers.
  #4  
Old February 4th, 2011, 04:22 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

The problem is you did not close your <input> tags. You basically had this:

<input type="hidden" name="word" value="' . search_price_value($_GET['word']) . '"

but it should be this:

<input type="hidden" name="word" value="' . search_price_value($_GET['word']) . '" />

HTML Code:
<?php
function search_price_value($word) {
    $word = strip_tags($word);
    return $word;
}
?>

<form method="get">
    <?php 
    
    if (@$_GET['word']) { 
    	echo '<INPUT TYPE="HIDDEN" NAME="word" Value="' . search_price_value($_GET['word']) . '" />'; 
    }
    
    if (@$_GET['ppp']) { 
    	echo '<INPUT TYPE="HIDDEN" NAME="ppp" Value="' . search_price_value($_GET['ppp']) . '" />'; 
    }
    
    if (@$_GET['sort']) { 
    	echo '<INPUT TYPE="HIDDEN" NAME="sort" Value="' . search_price_value($_GET['sort']) . '" />'; 
    }
    
    ?>

  <select name="price" id='store_dropdown_box'>
<option value="1-50"<?php if (@$_GET['price']=='1-50') {echo ' selected="selected"';}?>>Moins de 50</option>
<option value="50-100"<?php if (@$_GET['price']=='50-100') {echo ' selected="selected"';}?>>50 ~ 100</option>
<option value="100-150"<?php if (@$_GET['price']=='100-150') {echo ' selected="selected"';}?>>100 ~ 150</option>
<option value="150-200"<?php if (@$_GET['price']=='150-200') {echo ' selected="selected"';}?>>150 ~ 200</option>
<option value="200-250"<?php if (@$_GET['price']=='200-250') {echo ' selected="selected"';}?>>200 ~ 250</option>
<option value="250-"<?php if (@$_GET['price']=='250-') {echo ' selected="selected"';}?>>Plus de 250</option>

    </select>
    <input type="submit" value="Go" class="dfsbmt" />
</form>
  
<?php if (@$_GET['price']) { ?>
  <p><a href="[server.url type='fullpage' query='-price']">[X] Remove Filter</a></p>
<?php } ?>
  #5  
Old February 4th, 2011, 07:50 PM
ayorofrance ayorofrance is offline
 
Join Date: Sep 2010
Posts: 430
Default

Oh, dear!

Well spotted :-)

Amazing how well code works when it is written correctly...

Thank you!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out.

Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:54 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.