<solved> Event on a link without changing/refreshing page

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
trezel
New Member
New Member
Posts: 2
Joined: Thu Feb 16, 2012 2:12 pm

<solved> Event on a link without changing/refreshing page

Post by trezel »

Hi,

I need to put an onclick event on an element (text) of a page. But of course, I don't want the page to change (it must start a video at a defined time).
I've tried a lot of things, but it always goes to the index page, or refresh the page (I tried : href="#", {cms_selflink}, nothing in href...), or don't save the link (with empty href case).

Has someone a way to avoid this issue ?

Thank you
Last edited by trezel on Mon Feb 20, 2012 8:37 am, edited 1 time in total.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Event on a link without changing/refreshing page

Post by spcherub »

Hard to give advice confidently when your post does not include more details, but if you have a function you call on onclick(), end that call with "return false;" - this should, in theory, allow you to trap the call, do what you need, but change the default behavior.

Hope that helps.
-S
trezel
New Member
New Member
Posts: 2
Joined: Thu Feb 16, 2012 2:12 pm

Re: Event on a link without changing/refreshing page

Post by trezel »

Hi,

That's exactly what I was looking for. It works.
Thanks
Post Reply

Return to “The Lounge”