ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using Javascript / JQuery variables in the HTML code / EE tags?

July 24, 2008 9:55am

Subscribe [1]
  • #1 / Jul 24, 2008 9:55am

    kungfumonkey

    15 posts

    Hi everyone!

    I just copied my entry from other topic, casue I find it quite urgent:

    1) I have a template with weblog entries loop

    2) Each entry is displayed in a styled div

    3) Each div’s id is the entry {title}

    4) I have an input tag with onclick event for each div

    5) Onclick event is setting session variable

    Simplified, it looks like:

    {exp:weblog:entries weblog="my_weblog"}
    
    <div id="{title}">{body}<input id="{title}"></div>
    
    {/exp:weblog:entries}


    Basically, I want the session variable value to be the current entry’s title.

    Now, that’s the tricky bit;). If I put sth like {exp:session_variables:set name="vt_vatr" value="{title}”} in the onclick event, it’s always the title of the last entry which is stored to the variable.

    What I want to have insead is ‘the current one’. If I knew how to store the id of the actual input tag (being clicked on) to the variable, I think it would be solved.

    Can anyone help?

    Kind regards

    Luke S.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases