Can any one help me why am not able to set a magento session variable with the following code.
Mage::getSingleton('core/session')->setGiftMessage("<script type='text/javascript'>jQuery('#gift_message').val();</script>");
If the above implementation is wrong then please tell me how can i get a value of a text area
<textarea id="gift_message" rows="2" cols="75" name="gift-message"></textarea>
and set that value in a magento session variable to use it later.
Many thanks in advance .
Best Answer
I assume that the value is sent through post as some controller.
Just add this in the controller that handles the request:
Later you should be able to get it like this:
or if you want to retrieve it and remove it from session use this