Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Post back issue

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
smarty1
Smarty n00b


Joined: 25 Feb 2018
Posts: 3

PostPosted: Mon Mar 19, 2018 11:49 pm    Post subject: Post back issue Reply with quote

Hi.

I have a php function fire via ajax call when dropdown1 has on change event.
I get in an alert message the response shown from the php query result set
however I cannot put that result into my dropdown2 control. Any suggestions please? I have this all working in a .tpl file.

Thanks so much!!
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Tue Mar 20, 2018 2:18 am    Post subject: Reply with quote

This is "chained selects" and is javascript powered. This all happens in the user's browser, and is past the point of Smarty compiling the template.

See: https://appelsiini.net/projects/chained/

The only aspect of this that Smarty would get involved is if you had several templates to choose from, and had Smarty compile the chosen template to HTML, to have that HTML as the return to the AJAX call. The choice of template could be a series of <option> tags, a series of radio buttons, a series of checkboxes, etc.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development 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