• Resolved dpasserone

    (@dpasserone)


    Suppose that I use a table in a page (I am using the Enfold Child theme) and I want to reproduce the values of some table elements in another page.
    How can I access these values in javascript, say the element (3,2) of the table “table id=15”, in any HTML or PHP script of the same website?

    Thank you!
    Daniele

    • This topic was modified 6 years, 3 months ago by dpasserone.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    So, do you want JavaScript, HTML or PHP, that’s a bit of a difference here ??
    Now, your best chance probably is to use the Single Cell Shortcode Extension, see https://tablepress.org/extensions/table-cell-shortcode/
    With that, you can show the content of a single table cell on a different page.

    Regards,
    Tobias

    Thread Starter dpasserone

    (@dpasserone)

    Well I am quite free about the choice. PResently I am using Contact Form 7 that allows to use HTML and so-called “Form Tags”

    https://contactform7.com/tag-syntax/

    I never have investigated whether these tags can be replaced with “shortcodes” from TableCell…

    What do you think?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    so your actual goal here is to use values from table cells in such a contact form?
    To be honest, I have no idea if and how that could be possible ??
    I guess it really depends on where content for such form tags can come from, but I’m the wrong person to ask that, sorry.

    Regards,
    Tobias

    Thread Starter dpasserone

    (@dpasserone)

    Well, you already pointed to the element extension — let’s see
    Thank you very much!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    sure, no problem! I hope it helps! ??

    Best wishes,
    Tobias

    Thread Starter dpasserone

    (@dpasserone)

    Maybe a small extraquestion is:
    is the tablepress shortcode interpreted also in php scripts? I had the idea of including the shortcode directly here:

    https://gist.github.com/morgyface/56474f0a37abb7d622880daf6eff6e40

    instead of getting elements from the post I plan to get the value from your shortcode. Would it work?

    Thank you!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    you could use it in PHP code with a trick, by wrapping it in the Shortcode evaluation function:

    $shortcode_value = do_shortcode( '[table-cell ... /]' );
    

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Javascript access to the table elements’ is closed to new replies.