Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Assign Smarty variable from Javascript variable

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
dextranovich
Smarty n00b


Joined: 19 May 2018
Posts: 3

PostPosted: Sun May 20, 2018 11:14 am    Post subject: Assign Smarty variable from Javascript variable Reply with quote

Hello everyone,

I have the following code in my template file:
Code:
<input type="radio" name="AcceptTerms" id="AcceptTerms" value="Ja/Nein" />Ja/Nein
                             [{oxscript add="$('#AcceptTerms').change( function() { var radioButton = 'Ja';
                            console.log(radioButton);
                            });"}]


Now, in console when the radio button is clicked, I have 'Ja' printed, but I want to pass it's value into smarty variable because I will send it as a parameter in php function.

Is this possible and how I can do that?

Thank you
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1399

PostPosted: Sun May 20, 2018 1:44 pm    Post subject: Reply with quote

https://www.smarty.net/forums/viewtopic.php?p=93377
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP