Jump to content

Javascript to smarty


Recommended Posts

I'm trying to make pagination with input field.
For example: someone types a value in input field and when I press GO the value is passed to smarty so I can use the function

{$link->goPage($requestPage, $page)}

ere $page is the value in the input field. The thing is that I only know how to get the value of input field with javascript and I don't know how to pass it further to smarty so I can use it. Anyone has any ideas?

Thanks in advance.

Link to comment
Share on other sites

You can't do that directly, as Javascript is run on the client (i.e. browser) side, and php/smarty on the server side. Smarty's job is done (i.e. the page to show in the browser is created) before the javascript's job starts. You have to send the page value back to the server first, so that they can do something with it.


Read more about it in this link:



My 2 cents,


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...