checkout no refresh automatically in google chrome

  • Posts: 120
  • Thank you received: 2
11 years 1 month ago #152891

Hi dear
i am using this code in my checkout:

<select id="hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>" type="text" name="item[<?php echo $row->cart_product_id;?>]" class="hikashop_product_quantity_field"  value="<?php echo $row->cart_product_quantity; ?>" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>').value=qty_field.value;">
<option value="1" <?php if($row->cart_product_quantity == '1') echo 'selected="selected"'; ?> onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field && qty_field.value != '<?php echo $row->cart_product_quantity; ?>'){<?php echo $input; ?> qty_field.form.submit(); } return false;" title="<?php echo JText::_('HIKA_REFRESH'); ?>">1</option>
<option value="2" <?php if($row->cart_product_quantity == '2') echo 'selected="selected"'; ?> onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field && qty_field.value != '<?php echo $row->cart_product_quantity; ?>'){<?php echo $input; ?> qty_field.form.submit(); } return false;" title="<?php echo JText::_('HIKA_REFRESH'); ?>">2</option>
<option value="3" <?php if($row->cart_product_quantity == '3') echo 'selected="selected"'; ?> onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field && qty_field.value != '<?php echo $row->cart_product_quantity; ?>'){<?php echo $input; ?> qty_field.form.submit(); } return false;" title="<?php echo JText::_('HIKA_REFRESH'); ?>">3</option>
</select>

when i select a value in firefox my page is refresh automatically and it's work very good. but it's no refresh in google chrome.
what's my problem and it's not refresh automatically in chrome?
thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 1 month ago #152919

Hi,

You should not use a onclick event in your option tags. Instead you should use a onchange event in your select tag (like you actually already have).
It's probably why it doesn't work on Chrome.

The following user(s) said Thank You: kaya

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 2
11 years 1 month ago #152927

thank you dear Nicolas
my onclick event is:

onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field && qty_field.value != '<?php echo $row->cart_product_quantity; ?>'){<?php echo $input; ?> qty_field.form.submit(); } return false;"
when i remove it's from my code it's not work any browser. how can do it work in all browser?
thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 1 month ago #152936

As I said you should remove the onclick in your option tags and add your auto submit in the onchange attribute of the select tag.
If you just remove the onclick, it won't auto submit anymore.

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum