Advertisement
siristru

Change select on link click

Sep 2nd, 2021
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <p class="location-write-email"><i class="fas fa-envelope"></i> <a href="#contact-form" class="odbiorca-value" data-form="<?php echo $this->item->id; ?>"><?php echo JText::_('MY_CONTACT_LINK'); ?></a> <i class="fas fa-chevron-right"></i></p>
  2.  
  3. <script>
  4. jQuery('.odbiorca-value').on('click',function (e) {
  5. var q = jQuery(this);
  6. var target = q.attr('data-form');
  7. jQuery("#odbiorca option[data-value="+target+"]").prop("selected","selected");
  8. //e.preventDefault();
  9. });
  10. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement