Jump to content

Save the value from Javascript to PHP


KenFranklin

Recommended Posts

I write code on Prestashop 1.6 module. In the admin click on the <div id="2" class="color-box"> with ID. Read ID value via jQuery. How to keep it in PHP variable ($a=2(id="2"))?
--------

$res .= '<script>$(".color-box").click(function() {var a = $(this).attr("id");'.Configuration::updateValue('a', 'this_is_value').'});</script>';

--------

How to pull var a and send it to the PHP 'this_is_valie'?

Thank you

Edited by workstyling (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...