0

I want

<?php } ?>
<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'information/contact') { ?>
		$('#tab_contact').addClass('selected');
<?php } ?>

to replace <a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a> How can i do this?

3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by lobebe
0

WAY too few details to work with, try writing down again what your precise goal is, and it's results.
The way it looks now, is that you want to generate Javascript to change a link filled in by PHP.

If so, just use getELementById in your javascript. php is already done by the time JScript begins

0

I am completely new to php and i don't understand what you have just said.

0

You want to set a menu section as active if a certain page is open? Well, you do know that you need to wrap that jquery part with <script></script> tags, right? Also, check that route var output to see if it's correct.

0

So are you suggesting i do it this way:

<script>
<?php } ?>
<?php if (isset($this->request->get) && $this->request->get == 'information/contact') { ?>
$('#tab_contact').addClass('selected');
<?php } ?>


</script>

or what?

Edited by Nick Evan: Fixed formatting

0
<?php } ?>
<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'information/contact') { ?>
<script>
$(function() {
$('#tab_contact').addClass('selected');
});
</script>
<?php } ?>

more like this

Edited by Buppy: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.